带有 sw600dp 和 sw720dp 的 Android 布局
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11630013/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Android layout with sw600dp and sw720dp
提问by Rushabh Patel
I want to support 600dp
screen in my android application. So i have made that layout using layout-sw600dp
. But i cannot get the exact layout with the application.
我想600dp
在我的 android 应用程序中支持屏幕。所以我使用layout-sw600dp
. 但我无法获得应用程序的确切布局。
I got 800 X 1280
screen size with layout-sw720dp
but layout is little bit worse with 720 X 1280
size.
我得到了800 X 1280
屏幕尺寸,layout-sw720dp
但布局与720 X 1280
尺寸有点差。
So what can i do to support 720 X 1280
in layout-sw720dp
and 600 X 1024
in layout-sw600dp
?
那么我可以做些什么来支持720 X 1280
inlayout-sw720dp
和600 X 1024
in layout-sw600dp
?
回答by Arun
For tablets you can just create the layout and drawable with following qualifiers
对于平板电脑,您可以使用以下限定符创建布局和可绘制
layout-sw600dp drawable-sw600dp
布局-sw600dp drawable-sw600dp
which means tablet screen with minimum of 600dp and higher can use this layout and drawable.
这意味着最小 600dp 或更高的平板电脑屏幕可以使用此布局和可绘制。
So for standard configuration qualifiers for screen size you can create following configuration:
因此,对于屏幕尺寸的标准配置限定符,您可以创建以下配置:
1)layout-sw480dp drawable-sw480dp
2)layout-sw600dp drawable-sw600dp
3)layout-sw720dp drawable-sw720dp
Ref: thisgo for following Table 2. New configuration qualifiers for screen size (introduced in Android 3.2).
参考:这适用于表 2. 屏幕尺寸的新配置限定符(在 Android 3.2 中引入)。