2016-12-24 238 views
3

Android有一個默認的綠色淚珠,它出現在文本下方以幫助選擇文本或位置。如何在沒有@drawable的情況下更改顏色?我試過android:textSelectHandle="@color/colorPrimary",但那只是讓它消失了。如何更改EditText的textSelectHandle顏色

<EditText 
    android:inputType="text" 
    android:layout_width="fill_parent" 
    android:layout_height="match_parent" 
    android:layout_toEndOf="@+id/imgMagnifyingGlass" 
    android:textAlignment="viewStart" 
    android:backgroundTint="@color/colorWhite" 
    android:textCursorDrawable="@null" 
    android:textSelectHandle="@color/colorPrimary" 
    android:textColor="@color/colorGray" 
    android:id="@+id/editTextWord" /> 
+4

參考http://stackoverflow.com/questions/29795197/how-to-change-color-of-edittext-handles – sasikumar

回答

3

我固定它通過增加這個我styles.xml:

<item name="colorControlActivated">@color/colorPrimary</item> 

所有其他公認的關於這個主題的答案涉及@drawable S和這似乎是最簡單的方法。