我必須使用浮動提示標籤進行textinputlayout,需要有白色背景。有些什麼類似this--在TextInputLayout中浮動提示中的不透明背景
設計預期:
但這一切我已經能夠到目前爲止,要做到這一點:
用實際設計TextInputLayout:
目前TextInputLayout中的提示標籤具有透明背景。 任何人都可以請幫助我,並告訴如何使這成爲可能?
這裏是我的代碼(texinput佈局):
<android.support.design.widget.TextInputLayout
android:id="@+id/til_login_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/text_input_layout_background"
app:hintTextAppearance="@style/TextStyle.Small.Hint">
<EditText
android:id="@+id/login_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/transparent"
android:gravity="center_vertical"
android:hint="Email/Mobile"
android:inputType="text"
android:textSize="14sp" />
</android.support.design.widget.TextInputLayout>
,我使用
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:gravity="bottom"
android:top="5dp">
<shape android:shape="rectangle">
<stroke
android:width="1px"
android:color="@color/Grey300" />
<corners android:radius="100dp" />
<solid android:color="@color/transparent" />
</shape>
</item>
</layer-list>
提前感謝的背景!
能否請您分享您的代碼? –
@RafiKamal我添加了我正在使用的代碼 – anup1912