Quantcast
Channel: Programming – Xinyustudio
Viewing all articles
Browse latest Browse all 284

Android EditText control: using old rectangle style

$
0
0

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!


Filed under: Android, Java, Programming Tagged: android, EditText, rectangle, style, underline

Viewing all articles
Browse latest Browse all 284

Trending Articles