Kaloyan Roussev
Kaloyan Roussev

Reputation: 14711

EditText dimensions change if I use color as a background?

EditText views shrink in size if I use this to change their color:

    android:background="@android:color/white"

Why is this happening? How can I make them white and maintain their size? I dont like the default grey look they have. Same question regarding spinners...

Upvotes: 5

Views: 1492

Answers (2)

Hamad
Hamad

Reputation: 5152

  • try to give fixed width and height or your problem could be solved by this too: What should you do is to create a 9 patch image for edittext and set that image as edit text background. You can create 9 patches using this website click here

Try use it as edittext background and you will get an idea.Right click the image and select "save image as". When you save the image dont forget to give its extension as "9.png"

Upvotes: 0

thinear
thinear

Reputation: 46

1、You can set minHeight attribute in xml layout 2、you can set a white background image that has the same height with the system edittext's backgound image. 3、you can just set background as transparent color and a white background to it's parent view.

Upvotes: 3

Related Questions