我想在每个屏幕上显示屏幕的每个项目/行。但是我在 dp 中为行的 xml 指定高度和宽度以实现它。因为我指定了高度/宽度,所以每一行都不完全适合屏幕,也不适合所有类型的屏幕分辨率。我将如何实现这一目标?任何人都可以对此提出想法吗?
这是 xml 文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="schemas.android.com/apk/res/android"
android:layout_width="1024dip"
android:layout_height="480dip"
android:orientation="vertical" >
<TextView android:layout_width="1024dip"
android:layout_height="480dip"
android:text="ViewSwitcher"
android:textSize="20sp"
android:gravity="center"
android:padding="10dip"
android:background="#404040"
android:id="@+id/textView" />
</LinearLayout>
提前致谢。
最佳答案
请使用线性布局,利用weightsum的特性,你可以将屏幕分辨率划分到任意范围......
关于Android:适合每个屏幕的 ListView 的每个项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14168873/