Android Text Click Color
當點擊Button時,想要改變Button上文字的顏色,我們可使用resource xml的方式來實現。
步驟如下
Step 1: 建立color資料夾
在res底下建立color資料夾。
Step 2: 建立color檔案
在color資料夾底下建立xml檔案, 內容如下
1 | <selector xmlns:android="http://schemas.android.com/apk/res/android" > |
Step 3: 設定文字顏色
1 | <Button |
Android Text Click Color
https://nickcarter9.github.io/2019/10/25/2019/2019_10_25-text-click-color/