How to write on the border of editing text

I need to create an edit text containing text related to this text field. How to do it. Although there are some ways through HTML. But I do not know how to do this in Android. Can anyone suggest me something for this. For a clear view, I am providing a sample snapshot of my requirement.

Any help would be appreciated

enter image description here .....

+4
source share
2 answers

You can achieve something like this by doing this,

<RelativeLayout android:layout_width="fill_parent" android:id="@+id/myLayout1" android:layout_height="wrap_content"> <EditText android:text="EditText" android:id="@+id/editText1" android:layout_marginTop="5dp" android:layout_width="fill_parent" android:layout_height="wrap_content"> </EditText> <TextView android:text="TextView" android:id="@+id/textView3" android:layout_marginLeft="10dp" android:textColor="#000000" android:background="#FFFFFF" android:layout_width="wrap_content" android:layout_height="wrap_content"> </TextView> </RelativeLayout> 

Image of my testing

+3
source

I think using android:hint also useful to place text relevant for text editing .

But the text will be displayed only when the editing text is empty, as well as inside the editing text, but not the way you showed here.

I think the layout you showed here may take longer.

-1
source

Source: https://habr.com/ru/post/1402394/


All Articles