问题:在相同分辨率屏幕上,布局在不同设备上显示不同。我在三星Galaxy S4(1080x1920)和LG G2(1080x1920)上进行了测试。它们具有相同的分辨率,为什么在每个设备上布局显示不同?
我将所有内容放在布局文件夹中,并没有其他分辨率的布局文件。
以下是屏幕截图:
我将所有内容放在布局文件夹中,并没有其他分辨率的布局文件。
以下是屏幕截图:
- 三星Galaxy S4
http://www.image-share.com/ijpg-2963-272.html
- LG G2
http://www.image-share.com/ijpg-2963-271.html
编辑 #1
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/layoutMain"
tools:mContext="com.test.app.flock.mActivity">
<ImageView
android:id="@+id/imageViewImageBackground"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone" />
<View
android:id="@+id/viewBackground"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background01" />
<View
android:id="@+id/viewFingerprint"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/fingerprint01"
android:visibility="gone" />
<Button
android:id="@+id/buttonScanning"
android:layout_width="162dp"
android:layout_height="130dp"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="41dp"
android:background="@android:color/transparent" />
<ImageView
android:id="@+id/imageViewScanner"
android:layout_width="162dp"
android:layout_height="130dp"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="41dp"
android:src="@drawable/line01"
android:visibility="gone" />
<TextView
android:id="@+id/textViewResult"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="180dp"
android:text="SCANNING"
android:textSize="30sp"
android:textColor="@android:color/white"
android:textStyle="bold"
android:gravity="center"
android:visibility="gone" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="112dp"
android:orientation="vertical">
<DigitalClock
android:id="@+id/digitalClock"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="7"
android:textSize="30sp"
android:textColor="@android:color/white"
android:gravity="center"
android:textStyle="bold" />
<TextView
android:id="@+id/textViewDate"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="10"
android:text="10 Grudzien 2015"
android:textSize="20sp"
android:textColor="@android:color/white"
android:gravity="center"
android:textStyle="bold" />
</LinearLayout>
170 ppi密度)”,而华为(https://www.gsmarena.com/huawei_mediapad_t3_7_0-8635.php)则说:“600 x 1024像素,16:9比例(170 ppi密度)”。我只发现了一个区别:7.0英寸,137.9平方厘米(72.2%屏幕占比)和7.0英寸,137.9平方厘米(74.3%屏幕占比)。 - Patrick