2017-08-27 222 views
1

如果佈局設置一個TextView下面的文字顏色,我不能誇大佈局...崩潰膨脹的佈局設置TextView.TextColor

android:textColor="?android:attr/textColor" 

我相信價值爲明確限定時應用程序,因爲我有一個drawable也引用這個資源,它的工作原理很好。但是,如果我嘗試使用重音顏色,那麼它會正常工作,例如

android:textColor="?android:attr/colorAccent" 

textColor值有什麼不同?

回答

2

我會假設你正在尋找你的主題的主要文本顏色,這樣你可以使用:

android:textColor="?android:attr/textColorPrimary" 

有十幾textColorXXXX屬性,所以你需要審查他們看看你實際上試圖使用哪一個。