Android Development: How Can I Make An EditText Plain So It's Just A White Square?
As the ti开发者_如何学Gotle says, I've seen EditTexts where they are just plain white with no smooth corners or orange android border when you highlight it etc.
Like it looks in this app: http://s1.appbrain.com/screen?id=-2631427781674403509&i=1
You need to create a custom background 9-patch image like this one and put it to /res/drawable
directory. Here is the tutorial for 9-patch images. Then you need to apply the image as a background for your EditText
using android:background
attribute.
Here is a sample layout xml:
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/white_bg"
android:text="Test"
android:layout_marginBottom="5dip" />
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/white_bg"
android:text="Currently focused" />
And here is the result:
精彩评论