android - 三星 Galaxy S4 屏幕尺寸

标签 android

<分区>

我正在尝试开发与 galaxy S4 兼容的应用程序。 我知道我需要在 list 中添加屏幕密度 480,但它是归类为普通屏幕还是大屏幕,因为人们有不同的说法?

例如,如果我在 galaxy S4 上运行以下代码,尺寸会产生什么结果?

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

size = 2 = Normal, 
size = 3 = Large

最佳答案

在您的开发中,您不应该为星系 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

关于android - 三星 Galaxy S4 屏幕尺寸,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18234868/

相关文章:

android - 带动画的 fragment 交易使谷歌地图变黑

java - ZXing on Android PDF417

android - RecyclerView 滚动性能缓慢,并且在滚动时有时会延迟/停止

android - 在 RecyclerView 中展开 View 不能正确设置动画

android - react native : Blank space between FlatList rendered items

java - DialogFragment - show() 方法

android - 地理定位不起作用 ionic 3 - android

android - 在Cordova中基于解析电话的登录

Android - 对话框 fragment 顶部的 float 操作按钮

Android 和 Arduino 都通过蓝牙接收到奇怪的值