android上的自定义编辑文本
我是android布局的新手,所以我需要一些帮助 我想创建一个自定义editText,如下所示: 我想用最好的方法解决这个问题 有人吗android上的自定义编辑文本,android,android-layout,android-edittext,frontend,android-custom-view,Android,Android Layout,Android Edittext,Frontend,Android Custom View,我是android布局的新手,所以我需要一些帮助 我想创建一个自定义editText,如下所示: 我想用最好的方法解决这个问题 有人吗 谢谢。U可以创建一个可绘制的并将形状可绘制设置为EditText背景如果您想要左边的蓝线,您可以在EditText上设置背景,例如 <EditText android:layout_width="0dp" android:layout_height="wrap_content" android:la
谢谢。U可以创建一个可绘制的并将形状可绘制设置为EditText背景如果您想要左边的蓝线,您可以在EditText上设置背景,例如
<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:background="@drawable/custom_edittext"
android:layout_weight="1" />
谢谢你,你帮了我很多。这已经存在了。检查并查找MaterialEdit文本。
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:bottom="-5dp"
android:right="-5dp"
android:top="-5dp">
<shape android:shape="rectangle" >
<solid android:color="@color/color_of_the_background" />
<stroke
android:width="5dp"
android:color="@color/color_of_the_border" />
</shape>
</item>
</layer-list>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/custom_layer">
</item>
</selector>