[英]Is it possible to inherit an anim xml resource from another and overwrite attributes?
[英]Is it possible to inherit the attributes of a xml file?
例如,在創建列表項時,我想重用Android的simple_list_item1.xml
或simple_list_item2.xml
,但我還想調整它們。
那么,有沒有任何方法可以繼承在xml中聲明的這些視圖的屬性?
我現在的解決方案是將simple_list_item1.xml
中的所有屬性復制到自定義樣式,然后讓TextView繼承該樣式。 但我希望直接從android獲取數據,這樣如果將來發生變化,我的觀點也會繼承這些變化。
它不可能在OOP模型中使用繼承。 使用它的最佳方法是將源復制並粘貼到您自己的項目中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.