Reputation: 1481
How can I edit text shape like this.
I mean that right rounded corners and exact same shape. As I understood 9 patch doesn't help me with that.
Upvotes: 0
Views: 314
Reputation: 3937
This ninepatches will help you. just apply this ninepatch images as backgroud of the editText
Upvotes: 1
Reputation: 2790
You have to create background image for your EditText
. For the other layout, you have to create layout which will look like this. Its not the exact xml but showing you the idea.
<RelativeLayout layout_width="match_parent" layout_height="50dp">
<EditText layout_width="wrap_content" layout_height="wrap_content"
android:background="@drawable/editTextBackground" layout_alignParentLeft="true" layout_marginLeft="10dp">
<ImageView layout_width="wrap_content" layout_height="wrap_content"
centerVertical="true" marginLeft="15dp"
android:background="@drawable/smily" />
<ImageView layout_width="wrap_content" layout_height="wrap_content"
centerVertical="true"
alignRight="@id/editTExt"
android:background="@drawable/camera" />
<ImageView layout_width="wrap_content" layout_height="wrap_content"
centerVertical="true" marginLeft="15dp"
alignParentRight="true"
android:background="@drawable/mic" />
</RelativeLayout>
Hope this gives you the idea.
Upvotes: 0
Reputation: 35579
9 patch will be best way in your situation, create 9 patch and set it as background of your EditText
.
Here i am giving you sample image, you can try with it.
editText.setBackground(R.drawable.edt_bg);
Upvotes: 2