0

How can I edit text shape like this.

enter image description here

I mean that right rounded corners and exact same shape. As I understood 9 patch doesn't help me with that.

liam_g
  • 314
  • 1
  • 5
  • 15
Pasha Shkaran
  • 1,433
  • 2
  • 23
  • 41

3 Answers3

2

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.

enter image description here

editText.setBackground(R.drawable.edt_bg);
Ravi
  • 34,851
  • 21
  • 122
  • 183
1

This ninepatches will help you. just apply this ninepatch images as backgroud of the editText

image1

image2

Jackson Chengalai
  • 3,907
  • 1
  • 24
  • 39
0

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.

Mustansar Saeed
  • 2,730
  • 2
  • 22
  • 46