I try to make a rouned EditText.It display well in the Graphical layout in main.xml. But it is still square when i launch the AVD.Here is the code:
<EditText
android:id="@+id/et"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:padding="5dp"
android:hint="Enter a #hashtag or keyword"
android:textColor="#000000"
android:drawableLeft="@drawable/magnifier"
android:background="@drawable/rounded_edittext"
android:textSize="16dp" >
<requestFocus />
</EditText>
<!-- res/drawable/rounded_edittext.xml --> <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:padding="10dp"
android:shape="rectangle" >
<solid android:color="#FFFFFF" />
<corners
android:bottomLeftRadius="15dp"
android:bottomRightRadius="15dp"
android:topLeftRadius="15dp"
android:topRightRadius="15dp" />
This a rounded edit text that change also behavour on clik states, Simply use thes xml
Normal rounded edittext:
Pressed,Focused edittext
And… now, the EditText should look like:
i used this layout to test it for and it works for me even with multiple round edittext:
this is the layout i use
and this is a screen capture of the result on emulator: