Hi, I want to add an textbox just like the image above in android app. I used the edittext control,but cannot show border.
Create a new xml file edit_text_border.xml
in drawable folder, or give name of your choice. Then add the following code:
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid
android:color="@android:color/transparent"/>
<corners
android:bottomRightRadius="12dp"
android:bottomLeftRadius="12dp"
android:topLeftRadius="12dp"
android:topRightRadius="12dp"/>
<stroke
android:color="#ffffff"
android:width="1dp"/>
</shape>
You can adjust the stroke color and radius values to your requirements. Finally, in your edittext
set it as background like following.
<EditText
android:id="@+id/edit_text"
android:background="@drawable/edit_text_border"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With