我正在编写一款在720p屏幕上运行良好的应用程序。我想让这个应用程序在不同的屏幕尺寸上运行。我读过这篇文章:http://developer.android.com/guide/practices/screens_support.html使用多种布局支持Android中的多种屏幕尺寸
但我很困惑。我为不同的布局制作了3个文件夹(layout-normal,layout-large,layout-xlarge),并在每个文件夹中放置了不同的XML文件。但有一些屏幕布局正常,我的应用程序在其中一些上看起来不错,而在其他一些上看起来很糟糕。例如,这些尺寸是正常的布局:(4.7“WXGA,4”WVGA,3.7“WVGA,...)但我的应用在4”和3.7“上看起来不错,而在其他类型上看起来很不好。活动的main.xml中的布局,正常的文件夹是:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/backasli"
android:orientation="vertical" >
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingBottom="100dp"
android:paddingTop="140dp"
android:stretchColumns="3" >
<TableRow
android:id="@+id/tableRow6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center" >
<TextView
android:id="@+id/txt1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="pray :"
android:textColor="#031a7b"
android:textSize="15sp" />
</TableRow>
<TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center" >
<TextView
android:id="@+id/namaztxt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="#031a7b"
android:textSize="20sp" />
</TableRow>
<TableRow android:gravity="center" >
<Button
android:id="@+id/buttonchange"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:background="@drawable/ubtn"
android:text="change"
android:textColor="#ffffff"
android:textSize="20sp" />
</TableRow>
</TableLayout>
</LinearLayout>
我想android:paddingBottom =“100dp” android:paddingTop =“140dp”这会让你的设备对齐问题?在某种意义上它显示的不好? – Lokesh
@Lokesh。究竟!!!这些焊盘会产生问题 – user2855778
然后根据所有布局中的屏幕更改填充。 – Lokesh