1

I want to dynamically add an image in EditText. I followed this question to do that and I have succeeded. but, the thing is I cannot scale this image to the size of my text field. It is smaller than my text field.

Here is my text field.

 <EditText
                android:id="@+id/codeEdit"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@drawable/ic_passcode"
                android:width="200dp"
                android:height="1000dp"
                android:layout_marginTop="20dp"
                android:ems="10"
                android:gravity="center"
                android:inputType="textPassword">
                <requestFocus />
            </EditText>

It displays like this.

image

How can I scale this image?

Community
  • 1
  • 1

1 Answers1

2

@Manu : Nine Patch: an extension to the PNG format allows it to specify information about how to stretch it and place things inside of it. so i think its your 9 patch image problem .

Here is downloadable one which is good, it has a simple but clever default image.Try this way.

I hope it will helps you .

IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198