Large layout affects Galaxy Note

旧巷老猫 提交于 2019-12-22 17:57:15

问题


I want my app to have a specific layout for Android tablets and another for mobiles.

In order to do this, I have created two layout files in two folders, like this:

layout/main.xml

and

layout-large/main.xml

I want the small layout to be applied to Galaxy Note. However, the large layout is applied (which is normal, since its resolution qualifies it as large screen). Since this layout does not fit well to Galaxy Note's screen size, is there a way to apply the 'normal' layout to Galaxy Note?


回答1:


Galaxy Note has actually a 'large' screen. 'large' means the size between ~4.5" and 7".

So I would recommend to use your tablet-layout only on 'xlarge' devices (>7"): layout-xlarge/main.xml

For more info, have a look at this dev guide page.




回答2:


If you want to differentiate between different size tablets (like the nexus 7 and galaxy tab), you'll still need to have the large and xlarge folders.

I think a better way to do this is to use this specific folder for the Note:

layout-large-port-xhdpi-1280x800

You can be pretty confident that future tablets won't be grouped into this folder. Since they are larger than the Note, if they are 1280x800 resolution, they won't be considered xhdpi.

Also, new versions of the Note are classified as normal size now, so I'd imagine this to be the trend for future phones of this size.




回答3:


You can also try to use a folder with name:

layout-sw600dp

Regards, Quentin




回答4:


That's because since layout-large does not match the screen you want (this case tablet which is xlarge) it will go to the default layout which is located in layout/

Check here http://developer.android.com/guide/practices/screens_support.html



来源:https://stackoverflow.com/questions/9826803/large-layout-affects-galaxy-note

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!