Issue
I am trying to make a custom edit text that has only a bottom border. I have tried this code and set it as background:
<item android:gravity="bottom">
<shape android:shape="line">
<stroke android:width="1dp" android:color="@color/lightGray"/>
<padding android:left="12dp" android:right="12dp" android:top="12dp" android:bottom="12dp" />
</shape>
</item>
and the border is exactly how I want it but it is placed in the middle of the edit text and not at the bottom. How can I solve this?
Solution
You can create a bottom bordered edittext by using ; the below xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:bottom="1dp"
android:left="-2dp"
android:right="-2dp"
android:top="-2dp">
<shape android:shape="rectangle" >
<stroke
android:width="0.5dp"
android:color="@android:color/black" />
</shape>
</item>
</layer-list>
Answered By - Shiva Snape
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.