Damir Damir -4 years ago 133
Android Question

EditText set text start 10dp from left border

Is possible in android EditText widget to set that text start 10dp from left border ? When I type something at the moment it is glued to left side and I need to put a little padding.

Answer Source

This can be achieved with the android:padding attribute.

<EditText
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:padding="10dp" />

has a 10dp padding on all sides

you may just want to specify the left and right padding.

<EditText
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:paddingLeft="10dp"
    android:paddingRight="10dp" />

Will make the padding on the left and right be 10dp.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download