1

I am trying to develop an app compatible with the galaxy S4. I understand I need to add the screen density 480 in the manifest, but is it classed as normal or large screen as people are saying different things?

For example, if I ran the following code on a galaxy S4, what would size result in?

int size = getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK;

size = 2 = Normal, 
size = 3 = Large
4

1 回答 1

2

在你的开发中,你不应该为一个星系 SIV 做任何特定的事情,一切都会扩展。

如果您想使用不同的资源,可以使用文件夹中的限定符:

res/layout/main_activity.xml           # For handsets (smaller than 600dp available width)
res/layout-sw600dp/main_activity.xml   # For 7” tablets (600dp wide and bigger)
res/layout-sw720dp/main_activity.xml   # For 10” tablets (720dp wide and bigger)

这个页面会教你很多有用的技巧:http: //developer.android.com/guide/practices/screens_support.html

于 2013-08-14T14:53:24.797 回答