Android Style和自定义属性
文章目录 1. Android Style & Theme 1.1 基本概念 1.1.1 Style(样式) 1.1.2 Theme(主题) 1.2 创建和应用style 1.3 扩展和自定义style 1.4 创建和应用theme 1.5 扩展和自定义theme 1.6 添加指定版本的style 1.7 Style层级 1.7.1 TextAppearance 2 Android 自定义属性 2.1 创建自定义属性步骤 2.2 AttributeSet 2.3 TypedArray 2.4 declare-styleable 2.5 obtainStyledAttributes 2.5.1 obtainAttributes(AttributeSet set, int[] attrs) 2.5.2 obtainStyledAttributes(int[] attrs) 2.5.3 obtainStyledAttributes(int resId,int[] attrs) 2.5.4 obtainStyledAttributes(AttributeSet set, int[] attrs, int defStyleAttr, int defStyleRes) 3 几种赋值属性方法 3.1 将单个属性直接应用于view 3.2 将一个style应用于view 3.3