适用于不同屏幕尺寸的Android布局文件夹 [英] Android layout folders for different screen sizes
问题描述
我有一个应用程序,需要确保从不同的布局文件夹中提取不同的设备.我需要从Note 5(2560 x 1440)以外的文件夹中提取一个nexus 5(1920 x 1080).
I have an app that I need to ensure different devices are pulling from different layout folders. I need a nexus 5 (1920 x 1080) to pull from a different folder than a Note 4 (2560 x 1440).
当前,无论文件夹名称如何组合,它们都从同一文件夹中拉出.
Currently, no matter what combination of folder names, they both pull from the same folder.
我尝试过:
layout-xxhdpi & layout-xxxhdpi
(它们都来自xxhdpi)
(they both pull from xxhdpi)
layout-sw320dp & layout-xxhdpi
(它们都从layout-sw320dp中提取
(they both pull from layout-sw320dp
layout-large & layout-xlarge
(它们都从大版面中提取)
(they both pull from layout-large)
在这种情况下正确的布局文件夹约定是什么?
What would be the proper layout folder convention for this situation?
推荐答案
所以这似乎是唯一对我有用的安排...
So this seems to be the only arrangement that worked for me...
layout
(Nexus 4和5)
layout
(Nexus 4 & 5)
layout-sw440dp-port
(注释4,Nexus 6)
layout-sw440dp-port
(Note 4, Nexus 6)
layout-sw720dp-port
(三星10英寸平板电脑)
layout-sw720dp-port
(Samsung 10" tablet)
(我从端口"上取下了它不起作用...);-)
(It I take off the "port" it doesn't work...) ;-)
感谢所有建议!
这篇关于适用于不同屏幕尺寸的Android布局文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!