[英]How can I make this type of custom EditText UI?
使用材質設計的大綱框樣式=“ @ style / Widget.MaterialComponents.TextInputLayout.OutlinedBox”
此鏈接可能會幫助您http://qaru.site/questions/1688917/custom-textinputlayout-android
正如@ZahoorSaleem所說,您可以為此使用MaterialComponents。 您需要將設計支持庫添加到構建文件中。
布局將(簡化)如下所示:
<TextInputLayout
android:hint="Label"
style="style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<TextInputEditText />
</TextInputLayout>
put the below code in drawable and use this attribute in edittext
android:background="@drawable/nameofdrawablefile"
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#CC0505"/>
<stroke android:width="2dp" android:color="#CC0505" />
<corners android:radius="5dp" />
</shape>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.