Reputation: 379
I wanna make the editText to look like this:
what else should I do after I set the editText's background how can I make the text start inside the edittext via code.
Upvotes: 1
Views: 560
Reputation: 32093
As well as setting the background of the EditText view, set left and right padding, e.g.
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/edittext_bg"
android:paddingLeft="7dp"
android:paddingRight="7dp" />
Upvotes: 0
Reputation: 2027
Are you trying to get the EditText to say "Username" by default, but not have that be the actual text?
For that you can use EditText.setHint() (inherited from TextView) or in the xml definition use android:hint, such as
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="Username" />
Upvotes: 1
Reputation: 41749
To make text look like that, set the Gravity attribute to left. The gravity of EditText element.
Upvotes: 0