sriram
sriram

Reputation: 9052

Reducing the size of edittext in android

I'm very new to android and I want to reduce the size of EditText field in my layout.

For example if the user only need to enter 3 digits to the text field, then the size of the EditText should be small enough not the one provided by default.

Is that possible to do so?

Thanks in advance.

Upvotes: 0

Views: 2753

Answers (3)

Siva Sk
Siva Sk

Reputation: 1

You can use android:layout_margin="size you want"

use can also use android:layout_margin_left="size you want"

instead of "left" you can also right, top, bottom.

Upvotes: 0

Janmejoy
Janmejoy

Reputation: 2731

Try like this..

android:layout_width="wrap_content"

or

android:layout_width="20dp" //size your choice

Upvotes: 1

Subburaj
Subburaj

Reputation: 5192

In your Layout file set the attribute to that text field width as

android:layout_width="wrap_content"..This will take width as the text content entered into the field

Upvotes: 0

Related Questions