課程
/移動開發
/Android
/明日之星-RecyclerView
為什么DividertemDecoration類中并沒有修改ATTRS數組,而構造方法中確能夠得到樣式中定義的drawable?
2016-09-19
源自:明日之星-RecyclerView 2-3
正在回答
style.xml中放入<item name="android:listDivider">@drawable/shape</item>,會覆蓋默認風格,
DividertemDecoration類中的:
51行final TypedArray a = context.obtainStyledAttributes(ATTRS);會調用系統的分格屬性
public final TypedArray obtainStyledAttributes(@StyleableRes int[] attrs) { ? ?return getTheme().obtainStyledAttributes(attrs);}
舉報
帶領大家學習百變RecyclerView,絕對干貨,告別加班不是夢
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2016-09-21
style.xml中放入<item name="android:listDivider">@drawable/shape</item>,會覆蓋默認風格,
DividertemDecoration類中的:
51行final TypedArray a = context.obtainStyledAttributes(ATTRS);會調用系統的分格屬性
public final TypedArray obtainStyledAttributes(@StyleableRes int[] attrs) {
? ?return getTheme().obtainStyledAttributes(attrs);
}