最終更新:2016-01-22 (金) 03:15:38 (3018d)
Android/設定修飾子
<resources_name>-<qualifier>
命名規則
リソース名
修飾子
- Android 3.2からはdpでの指定が推奨
修飾子 (旧)
画面サイズ
Density
- tvdpiはオプショナル
dpベース (Android 3.2以降)
- Beginning with Android 3.2 (Android/APIレベル13), the above size groups are deprecated and you should instead use the sw<N>dp configuration qualifier to define the smallest available width required by your layout resources.
smallestWidth
- sw<N>dp (smallest width N dp)
- アプリ描画領域で最も短い辺の長さが<N>dpより大きい場合に参照されるリソース
Available screen width
Available screen height
- h<N>dp (height N dp)
- アプリ描画領域の高さが<N>dpより大きい場合に参照されるリソース
注意点
- The sizes that you specify using these qualifiers are not the actual screen sizes. Rather, the sizes are for the width or height in dp units that are available to your activity's window. The Android system might use some of the screen for system UI (such as the system bar at the bottom of the screen or the status bar at the top), so some of the screen might not be available for your layout. Thus, the sizes you declare should be specifically about the sizes needed by your activity—the system accounts for any space used by system UI when declaring how much space it provides for your layout. Also beware that the Action Bar is considered a part of your application's window space, although your layout does not declare it, so it reduces the space available for your layout and you must account for it in your design.
優先順位
- layout-h<N>dp > layout-sw<N>dp > layout-w<N>dp > layout(デフォルト)
dpの例
- 320dp?: a typical phone screen (240x320 ldpi?, 320x480 mdpi, 480x800 hdpi?, etc).
- 480dp?: a tweener tablet like the Streak (480x800 mdpi).
- 600dp: a 7" tablet (600x1024 mdpi).
- 720dp?: a 10" tablet (720x1280 mdpi, 800x1280 mdpi, etc).
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)
その他
画面の向き
アスペクト比
MCCとMNC
言語と地域
レイアウトの方向
UIモード
- car
- desk
- television
- appliance
- watch
ナイトモード
タッチスクリーンタイプ
キーボードの使用可能状況
主なテキストの入力方法
ナビゲーションキーの使用可能状況
タップ以外の主なナビゲーション方法
プラットフォーム バージョン
選択方法
1.The system uses the appropriate alternative resource
- drawable-hdpi?とか
2.If no matching resource is available, the system uses the default resource and scales it up or down as needed to match the current screen size and density
- drawable?