AndroidのResource - Drawableリソース
DrawableリソースはAndroidで最も使われるリソースである。
直接.png,.jpg,.gif,.9.png等を使用するかXMLの使用も可能。
イメージリソース
直接.png,.jpg,.gif,.9.png等を/res/drawable-xxxフォルダに配置する。
[<package_name>.]R.drawable.<file_name> @[<package_name>:]drawable/file_name
StateListDrawableリソース
コンポーネントの状態により使用するリソースを切り替える。
要素
- root要素:<selector.../>
- 子要素:<item.../>
状態
- android:state_active
- android:state_checkable
- android:state_checked
- android:state_enabled
- android:state_fisrt
- android:state_focused
- android:state_last
- android:state_middle
- android:state_pressed
- android:state_selected
- android:state_window_focused
LayerDrawableリソース
要素
ShapeDrawableリソース
図形のXMLを定義する。
要素
ClipDrawableリソース
他のイメージの断片を表す。
要素
AnimationDrawableリソース
動画を表す。
要素
- root要素 : <set.../>
- 子要素
- alpha
- scale
- translate
- rotate