0
我正在創建測驗並嘗試爲答案創建一致的樣式。我試圖改變CheckBoxes的字體顏色,但它沒有改變。雖然大小確實改變。Android Studio中的自定義樣式不起作用
這就是我對CheckBox規範的樣式和示例。當我在視圖中輸入android:textColor =「#eeba30」時,文本顏色會更改爲正確的顏色。
<style name="AnswerTextStyle">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textSize">50sp</item>
<item name="android:textColor">#eeba30</item>
</style>
<CheckBox
android:id="@+id/q1_correct1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="question1"
android:text="Ireland"
android:textAppearance="@style/AnswerTextStyle"/>
對不起,我是新來的android studio ...你在這裏添加的selector_checkbox是什麼?我是否在xml文件中添加這個?如果是這樣,它給了我很多錯誤。 –
在可繪製文件夾中創建selector_checkbox xml – user2025187
嘗試最後一個選項如果它不起作用,請嘗試第一個 – user2025187