2016-12-13 4 views
1

editText의 기본 색상을 분홍색에서 파란색으로 변경하는 방법을 알 수 없습니다. 여기에 이미지 설명을 입력기본 editText의 채색면을 변경하는 방법 Andriod Studio

여기
android:backgroundTint="@color/blue" 

는 EDITTEXT 상자 나를 위해 내 현재 XML

<EditText 
android:layout_width="match_parent" 
android:layout_height="wrap_content" 
android:inputType="textPersonName" 
android:text="@string/customword" 
android:ems="10" 
android:id="@+id/customword" 
android:layout_gravity="start" 
android:tint="@color/blue" 
android:textAlignment="viewStart" 
android:textSize="14sp" 
android:textColorLink="@color/blue" //no affect 
android:textColorHint="@color/blue" //no affect 
android:textColorHighlight="@color/blue" //no affect 
android:backgroundTint="@color/blue" 
tools:ignore="UnusedAttribute" /> 
여기

나는 분홍색에서 변경하려는 측면에 대한 스크린 샷은 다음과 같습니다 내가 사용 밑줄을 변경 manged했던

Pink Bubble

Pink Line

,536,

고마워 - 잭

+1

가능한 [Set EditText 커서 색상 설정] (http://stackoverflow.com/questions/7238450/set-edittext-cursor-color) – nikis

답변

1

당신이 원하는 커서 (거품) 색이 colorAccent 일치하므로 컬러로 악센트 색상을 설정해야 사용하기 그런 다음

<style name="AppTheme.EditTextOverlay" parent = "ThemeOverlay.AppCompat.Light"> 
    <item name="colorAccent">@color/blue</item> 
</style> 

당신의 EditText에 적용 : 다음 EditText의 색상, 당신은 테마 오버레이를 사용할 수 있습니다

<EditText android:id="@+id/customword" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_gravity="start" 
    android:inputType="textPersonName" 
    android:text="@string/customword" 
    android:ems="10" 
    android:textAlignment="viewStart" 
    android:textSize="14sp" 
    android:theme="@style/AppTheme.EditTextOverlay" /> 
+0

대단히 감사합니다! ☺ –

0

나는이 대답을 발견했다 here,이게 문제를 해결합니까?

android : textCursorDrawable 속성을 @null로 설정하면 android : textColor를 커서 색상으로 사용해야합니다. 단지 악센트를 변경하려면 당신이 선호하는 경우,

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> 
    <item name="colorPrimary">@color/colorPrimary</item> 
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item> 
    <item name="colorAccent">@color/blue</item> 
</style> 

을 또는 :

관련 문제