0
편집 텍스트의 경우 안드로이드의 재질 디자인에 플로팅 레이블에 배경색을 추가하고 싶습니다. 어떻게해야합니까?안드로이드의 재질 디자인에서 플로팅 레이블에 대한 배경색
편집 텍스트의 경우 안드로이드의 재질 디자인에 플로팅 레이블에 배경색을 추가하고 싶습니다. 어떻게해야합니까?안드로이드의 재질 디자인에서 플로팅 레이블에 대한 배경색
은 style.xml이
<android.support.design.widget.TextInputLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:theme="@style/TextLabel">
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="Hiiiii"
android:id="@+id/editText"/>
</android.support.design.widget.TextInputLayout>
처럼
<style name="TextLabel" parent="TextAppearance.AppCompat">
<!-- Hint color and label color in FALSE state -->
<item name="android:textColorHint">@color/Color Name</item>
<item name="android:textSize">20sp</item>
<!-- Label color in TRUE state and bar color FALSE and TRUE State -->
<item name="colorAccent">@color/Color Name</item>
<item name="colorControlNormal">@color/Color Name</item>
<item name="colorControlActivated">@color/Color Name</item>
또는
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:hintTextAppearance="@style/TextAppearance.AppCompat">
<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/prompt_password"/>
</android.support.design.widget.TextInputLayout>
편집을보십시오 : 단지 lable가 배경을 변경할 수 없습니다 당신 editext입니다 배경을 설정하려고하면 TextInputLayout 안에 래핑되어 출력이 비슷합니다.
이렇게하면 배경이 아닌 유동 힌트/레이블 색상이 변경됩니다. –
힌트 배경 만 변경 하시겠습니까 ?? – SaravInfern
예. 배경색 만 변경하고 싶습니다. –