读书笔记:Android开发艺术探索之第6章 android的Drawable

1,BitmapDrawable

2,ShapeDrawable

属性:

<shape
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape=["rectangle" | "oval" | "line" | "ring"] >
    <corners
        android:radius="integer"
        android:topLeftRadius="integer"
        android:topRightRadius="integer"
        android:bottomLeftRadius="integer"
        android:bottomRightRadius="integer" />
    <gradient
        android:angle="integer"
        android:centerX="integer"
        android:centerY="integer"
        android:centerColor="integer"
        android:endColor="color"
        android:gradientRadius="integer"
        android:startColor="color"
        android:type=["linear" | "radial" | "sweep"]
        android:useLevel=["true" | "false"] />
    <padding
        android:left="integer"
        android:top="integer"
        android:right="integer"
        android:bottom="integer" />
    <size
        android:width="integer"
        android:height="integer" />
    <solid
        android:color="color" />
    <stroke
        android:width="integer"
        android:color="color"
        android:dashWidth="integer"
        android:dashGap="integer" />
</shape>

博客连接:http://blog.csdn.net/czd3355/article/details/52691067

3,LayerDrawbale



4,StateListDrawbale

所有属性

Android中StateListDrawable支持的状态
android:state_active 代表是否处于激活状态
android:state_checked 代表是否处于已勾选状态
android:state_checkable 代表是否处于可勾选状态
android:state_enabled 代表是否处于可用状态
android:state_first 代表是否处于开始状态
android:state_focused 代表是否已得到焦点状态
android:state_last 代表是否处于结束状态
android:state_middle 代表是否处于中间状态
android:state_pressed 代表是否处于被按下状态
android:state_selected 代表是否处于被选中状态
android:state_window_focused 代表是否窗口已得到焦点状态


Android Drawable知识学习

http://www.jianshu.com/p/0d85e4d90e3c

猜你喜欢

转载自blog.csdn.net/luck_xiang/article/details/75546691