Edmund Rojas
Edmund Rojas

Reputation: 6606

android edit text making the text larger

When a user types into my edittext the text is a bit small, Id like to make this larger maybe 20-25 sp what is the best way of doing this?

Upvotes: 1

Views: 15062

Answers (4)

Aashish Bhatnagar
Aashish Bhatnagar

Reputation: 2605

<EditText 
    android:textColor="#000000"   
    android:background="@drawable/textboxbg"
    android:layout_width="726px"
    android:layout_height="wrap_content"
    android:inputType="none"
    android:id="@+id/number" 
    android:layout_alignParentRight="true"
    android:layout_gravity="center_horizontal"
    android:layout_marginLeft="10dp" 
    android:layout_marginRight="10dp"
    android:text=""
    android:textStyle="bold"
    android:textSize="50sp"
/>

Upvotes: 0

Raffaele
Raffaele

Reputation: 20885

Can't you simply add a textSize attribute to your XML layout? BTW, for unit dimensions dp is preferred over sp

Upvotes: 0

MByD
MByD

Reputation: 137312

Set the textSize attribute of the EditText view.

Upvotes: 1

Sparky
Sparky

Reputation: 8477

I'm a big fan of starting out with system-defined values. You can always tweak things later.

 <TextView style="@android:style/TextAppearance.Large" ...

Probably better in the long run to define yourself a family of styles in res/values, rather than the one-shot that I'm showing here.

Upvotes: 11

Related Questions