Question: I have an edittext for which I want to set below background![enter image description here](https://i.stack.imgur.com/xgiFQ.png)

but when I set this as background it stretches itself to fit in whole EditText like below image.![enter image description here](https://i.stack.imgur.com/70GuR.png)

and below is my code for xml file for editext

```
<LinearLayout
    android:id="@+id/footer"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:visibility="visible" >

    <EditText
        android:id="@+id/comment"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        android:layout_weight="1"
        android:hint="@string/add_your_comment"
        android:imeOptions="actionDone"
        android:padding="5dp"
        android:background="@drawable/bg_search_field"
        android:scrollHorizontally="true"
        android:singleLine="true" />

    <ImageView
        android:id="@+id/post_comment"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:padding="5dp"
        android:layout_marginRight="@dimen/fifteen_dp"
        android:src="@drawable/tick_selection" />
</LinearLayout>

```

How can I set the background correctly?

Answer: 
Ok So issue resolved simply by using nine patch image i have got from actionBarsherlock library which is using it for it's search view.
```
// try this
<LinearLayout
            android:id="@+id/footer"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:visibility="visible" >

        <LinearLayout
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:gravity="center_vertical">
            <EditText
                    android:id="@+id/comment"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:hint="add_your_comment"
                    android:imeOptions="actionDone"
                    android:padding="5dp"
                    android:background="@drawable/bg_search_field"
                    android:scrollHorizontally="true"
                    android:singleLine="true" />
        </LinearLayout>

        <ImageView
                android:id="@+id/post_comment"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:padding="5dp"
                android:layout_marginRight="@dimen/fifteen_dp"
                android:src="@drawable/tick_selection" />
    </LinearLayout>

   // also use my uploaded image which is editext background i'm apply 9-patch so now it not stretched if editext width is large.

```

![enter image description here](https://i.stack.imgur.com/uFoRZ.png)