How To Remove The Border Of Edittextfield In Android
How can I remove the border of a Edittext field in android. Actually it looks like this http://pbrd.co/V34sN7 With this layout code Copy
Solution 2:
Programmatic method:
setBackgroundDrawable(null);
Or, since setBackgroundDrawable() is deprectated in API 16:
if (Build.VERSION.SDK_INT >= 16)
setBackground(null);
else
setBackgroundDrawable(null);
Solution 3:
You can customize your EditText
by using the following xml layout
Save the following code asyourWishName.xml
<?xml version="1.0" encoding="UTF-8"?><selectorxmlns:android="http://schemas.android.com/apk/res/android">
//You can change the color of the edit text here which removes the border line as well
<itemandroid:state_focused="true" ><shapeandroid:shape="rectangle"><gradientandroid:startColor="#FFFFFF"android:endColor="#FFFFFF"android:angle="270" /><strokeandroid:width="3dp"android:color="#F8B334" /><cornersandroid:radius="12dp" /></shape></item><item><shapeandroid:shape="rectangle"><gradientandroid:startColor="#FFFFFF"android:endColor="#FFFFFF"android:angle="270" /><strokeandroid:width="0dp"android:color="#000000" /><cornersandroid:radius="12dp" /></shape></item></selector>
In EditText call the xml android:background="@drawable/yourWishName"
To Align right Use android:gravity="right"
Hope this helps
Solution 4:
You have to create a custom drawable nine patch file which hasn't got a border. Here you find a tutorial And the android:layout_gravity="right"
not means that the text is aligned to the right. It aligns the layout to the right. You have to use android:gravity="right"
.
Post a Comment for "How To Remove The Border Of Edittextfield In Android"