取得裝置螢幕的大小類型

1 篇文章 / 0 new
author
取得裝置螢幕的大小類型
switch (getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) {
    case Configuration.SCREENLAYOUT_SIZE_SMALL:
    break;
    case Configuration.SCREENLAYOUT_SIZE_NORMAL:
    break;
    case Configuration.SCREENLAYOUT_SIZE_LARGE:
    break;
    case Configuration.SCREENLAYOUT_SIZE_XLARGE:
    break;
}
Free Web Hosting