Custom editText on android -
i'm newbie android layout, need help.
i want create custom edittext, this:
i'm want fix best possible way.
someone?
thanks.
if want blue line on left, can set background on edittext, such as,
<edittext android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginleft="10dp" android:background="@drawable/custom_edittext" android:layout_weight="1" />
then create file in drawable folder called custom_layer.xml
<?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>
and final selector file - custom_edittext.xm
.
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/custom_layer"> </item> </selector>
Comments
Post a Comment