开发者

Android Development: How Can I Make An EditText Plain So It's Just A White Square?

开发者 https://www.devze.com 2023-01-29 07:49 出处:网络
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.

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:

Android Development: How Can I Make An EditText Plain So It's Just A White Square?

0

精彩评论

暂无评论...
验证码 换一张
取 消