Android 多屏灵活性
Android Multiple Screen Flexibility
2-3 年前,Android 开发人员使用布局文件夹来指定不同屏幕尺寸的尺寸。喜欢:-
布局(默认)
布局小(从 2.0″ 到 3.7″)
布局正常(从 3.7″ 到 4.3″)
大布局(从 4.0″ 到 7.1″)
layout-xlarge(从 7.0″ 到 10.0″)
我的问题是,现在,约定是什么,或者文件夹[=43]是什么=] 我们需要在哪里放置我们的布局以适应所有屏幕尺寸?
我在 developer.android 上查找了屏幕支持,但没有找到足够的答案。
我希望这对你有用
根据文档支持在文件夹下使用多屏幕。
layout-sw600dp ( For 7 inch tablet)
layout-sw720dp ( For more than 7 inch tablet)
创建这些文件夹并将这些文件夹放在给定路径下
res --> layout-sw600dp --> Your xml file ( i.e res/layout-sw600dp/main_activity.xml)
res --> layout-sw720dp --> Your xml file ( i.e res/layout-sw720dp/main_activity.xml)
对于较小的屏幕,使用默认布局文件夹。
2-3 年前,Android 开发人员使用布局文件夹来指定不同屏幕尺寸的尺寸。喜欢:-
布局(默认)
布局小(从 2.0″ 到 3.7″)
布局正常(从 3.7″ 到 4.3″)
大布局(从 4.0″ 到 7.1″)
layout-xlarge(从 7.0″ 到 10.0″)
我的问题是,现在,约定是什么,或者文件夹[=43]是什么=] 我们需要在哪里放置我们的布局以适应所有屏幕尺寸?
我在 developer.android 上查找了屏幕支持,但没有找到足够的答案。
我希望这对你有用
根据文档支持在文件夹下使用多屏幕。
layout-sw600dp ( For 7 inch tablet)
layout-sw720dp ( For more than 7 inch tablet)
创建这些文件夹并将这些文件夹放在给定路径下
res --> layout-sw600dp --> Your xml file ( i.e res/layout-sw600dp/main_activity.xml)
res --> layout-sw720dp --> Your xml file ( i.e res/layout-sw720dp/main_activity.xml)
对于较小的屏幕,使用默认布局文件夹。