我一直在尝试为一系列设备设置屏幕分辨率,我已经查找了所有答案,根据我的理解,如果我创建 res/layout-normal、res/layout-large 等,我可以在那里放置调整后的布局应用程序将自动加载它们。
怎么还没有出现这样的情况……
有人可以解释一下我创建布局和布局文件夹后要做什么吗
并允许在我的 XML 中使用所有大小(尽管我认为默认值是所有大小)。
谢谢你!
这只是一个例子:
设备分辨率-
res/values/dimens.xml(default)
res/values-ldpi/dimens.xml (240*320 and nearer resolution)
res/values-mdpi/dimens.xml (320*480 and nearer resolution)
res/values-hdpi/dimens.xml (480*800 and nearer resolution)
res/values-xhdpi/dimens.xml (720*1280 Samsung s3,Micromax HD canvas etc)
res/values-xxhdpi/dimens.xml (1080*1920 samsung s4,HTC one etc)
平板电脑分辨率-
res/values-sw600dp/dimens.xml (600*1024)
res/values-sw720dp-land/dimens.xml (800*1280)
<TextView
android:id="@+id/textView1"
style="@android:style/TextAppearance.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sample Text - Small" />
<TextView
android:id="@+id/textView2"
style="@android:style/TextAppearance.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sample Text - Medium" />
<TextView
android:id="@+id/textView3"
style="@android:style/TextAppearance.Large"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sample Text - Large" />
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)