RSS

Tag Archives: underline

Android EditText control: using old rectangle style


The latest android EditText looks like this (below left:

image   image

But I was asked to use old-style rectangle style (above right) to replace the current one. Here is how it is done:

  • Create a new xml file in res/drawable folder, which looks like this:

image

  • Next, in your activity’s layout xml file, append below 1-line code:

image

Note I: you don’t have to create the above xml file, and you can download this 14-line rect_tex_edit.xml file and directly put it in your project’s res/drawable/ folder.

Note II : the below code might be useful, which makes the cursor and text more legible and clear in the view:

android:textColor=”@android:color/black”
android:textCursorDrawable=”@null”

That is it. Enjoy this trick!

Advertisements
 
5 Comments

Posted by on August 26, 2013 in Android, Java, Programming

 

Tags: , , , ,