Attr、Style和Theme

這篇寫的還可以

http://www.jianshu.com/p/dd79220b47dd

不過漏掉一個問題

Android 中declare-styleable 和style 的不同

<resources>
    <style name="dsf">
        <item name="dd" >ddd</item>
    </style>
    <declare-styleable name="dsaf">
        <attr name="ss"/>
    </declare-styleable>
</resources>
style 中只能定義item,declare-styleable中只能定義attr,也就是說style是使用attr,declare-styleable是定義attr
此問題參考:

http://www.cnblogs.com/wangfenjin/archive/2012/09/05/2672007.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章