以下是Apple各类手机的分辨率
Priority | Manufacturer | Model | Resolution |
1 | Apple | 5 | 1136*640 |
2 | Apple | 5 | 1136*640 |
3 | Apple | 5 | 1136*640 |
4 | Apple | 4S | 960*640 |
5 | Apple | 4S | 960*640 |
6 | Apple | 4S | 960*640 |
7 | Apple | 5S | 1136*640 |
8 | Apple | 5S | 1136*640 |
9 | Apple | 5C | 1136*640 |
10 | Apple | 5C | 1136*640 |
11 | Apple | 4 | 960*640 |
12 | Apple | 4 | 960*640 |
13 | Apple | iPad 2 | 1024*768 |
14 | Apple | iPad Mini | 1024*768 |
15 | Apple | iPad Air | 2048*1536 |
16 | Apple | iPad 4 | 2048*1536 |
17 | Apple | iPad 3 | 2048*1536 |
18 | Apple | iPod Touch | 480*320 |
android分辨率较多
480*800 --------------hdpi
540*960 --------------xhdpi
如果是Tablet的话
drawable-sw600dp 7寸平板
drawable-w720dp 大于7寸的平板
drawable-large 适合所有平板
google官方推荐手机和平板的判断标准:
public static boolean isTablet() {
return (RingCentralApp.getContextRC().getResources().getConfiguration().screenLayout
& Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
}
android获取手机本身的信息
<span style="white-space:pre"> </span>DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
RCMConstants.screenWidth = dm.widthPixels;
RCMConstants.density = dm.density;
android按钮的几种状态:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/btn_call_disabled" android:state_enabled="false" />
<item android:drawable="@drawable/btn_call_pressed" android:state_pressed="true" />
<item android:drawable="@drawable/btn_call_nor" android:state_focused="true" />
<item android:drawable="@drawable/btn_call_nor" />
</selector>
下图是一个android工程res的目录: