[英]What style attribute do I use to change the color of an EditText's focused bottom line?
我正在嘗試從樣式中的聚焦EditText
更改底線的顏色。
當我開始編輯文本時, appcompat.Light
底線的顏色變為藍綠色。 我想知道這種顏色來自什么屬性。
另外,我還支持API 14,所以不能使用淡色。
您可以使用以下行在xml中更改此顏色:
android:backgroundTint="@color/blue"
您可以使用以下代碼在代碼中進行更改:
editText.getBackground().setColorFilter(getResources().getColor(R.color.blue), PorterDuff.Mode.SRC_ATOP);
您還可以通過在themes.xml文件中的樣式中添加以下行來更改應用程序中的所有位置:
<item name="colorControlActivated">@color/blue</item>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.