Reputation: 63872
There is EditText pictured on the left.
How to make text inside EditText and drawableRight to have padding as on the right?
The EditText has rounded corners, see android:background
,
however there is no interval set from EditText left edge to text start and from drawableRight to the EditText right edge.
<EditText
android:id="@+id/search_editbox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_gravity="center_vertical"
android:layout_toLeftOf="@id/search_execute_imageview"
android:layout_toRightOf="@id/layout_back_logo"
android:background="@drawable/rounded_edittext_states"
android:drawableRight="@drawable/abc_ic_clear_holo_light"
android:gravity="left|center_vertical"
android:hint="@string/search_hint"
android:maxLength="20"
android:padding="5dip"
android:singleLine="true"
android:textCursorDrawable="@null"
android:textSize="@dimen/main_text_size" />
I tried
android:paddingLeft="30dp"
android:paddingRight="30dp"
but it had no result.
Upvotes: 1
Views: 692
Reputation: 1422
Try this, it will work-
android:drawablePadding="30dp"
for interval between drawable and text.
Edit: actually remove padding
and paddingLeft
and paddingRight
Upvotes: 1