Here is my code for xml file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white_smoke"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<include layout="@layout/header" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" >
<TextView
android:id="@+id/tvAddContact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:background="@drawable/circle_trans"
android:gravity="center"
android:text="@string/plus_text"
android:textColor="@color/white_smoke"
android:textSize="40sp" />
</FrameLayout>
</RelativeLayout>
<include
layout="@layout/header_date"
android:paddingTop="10dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical"
android:paddingBottom="10dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="5dp" >
<RadioGroup
android:id="@+id/radioGroup1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:orientation="horizontal" >
<RadioButton
android:id="@+id/rbDownline"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:button="@drawable/btn_radio_selector"
android:checked="true"
android:text="@string/rb_downline"
android:textColor="@color/my_holo_text" />
<RadioButton
android:id="@+id/rbCustomer"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:button="@drawable/btn_radio_selector"
android:checked="false"
android:text="@string/rb_customer"
android:textColor="@color/my_holo_text" />
</RadioGroup>
<EditText
android:id="@+id/edSearchBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="30dp"
android:background="@drawable/gradient_ed_bg"
android:drawableLeft="@drawable/search"
android:hint="@string/search_contacts"
android:imeOptions="actionDone"
android:padding="8dp"
android:singleLine="true"
android:textColorHint="@color/my_holo_trans" />
<ListView
android:id="@+id/listContacts"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/gradient_bg_list_view_round"
android:cacheColorHint="#00000000"
android:divider="#149DCF"
android:dividerHeight="1dp"
android:listSelector="@drawable/list_selector_match_holo"
android:paddingBottom="5dp"
android:paddingTop="5dp" >
<requestFocus />
</ListView>
</LinearLayout>
<include layout="@layout/actionbar_title" />
</LinearLayout>
This xml shows output as following image,
As you can see that I am displaying an image in EditText box. I want to remove those padding type space ( marked as red ).
What should I do to remove it ?
use
android:drawablePadding="-2dip"
or whatever value do you need. Since you are using the drawableLeft
item, you need the drawablePadding
item as well, to adjust its padding
use
android:drawablePadding="10dp"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With