0

Hi i have a edittext with hint ..what iam trying to implement is whenever i am getting the info into the Edittext or when the user types into the edittext..the hint should stay and text user types should start below or beside hint...can we make the hint permanent?.or is there any way we can implement ..any suggestion is appreciated

EditText address = new EditText(activity);

                if (data.getAddress() != null
                        && !data.getAddress().trim().equals("")) {

                    address.setText(data.getAddress());
                } else {
                    address.setHint(R.string.address);
                }
Paresh Mayani
  • 127,700
  • 71
  • 241
  • 295
teekib
  • 2,821
  • 10
  • 39
  • 75

2 Answers2

1

You can set Background image of edit text.

Siddharth Lele
  • 27,623
  • 15
  • 98
  • 151
Ajay
  • 4,850
  • 2
  • 32
  • 44
1

You cant directly set a permanent hint for the editext . Instead you could use a text view along with the editext to show the hint text and make the background of both as transparent and give your own background to the layout holding both the text view and the edit text. It will create a view of editext with a permanent hint.

This Post will help you.

Community
  • 1
  • 1
Sahil Mahajan Mj
  • 11,033
  • 8
  • 53
  • 100