Change the appearance of the "Edit text" window in android

I want to change the way the editing text is displayed ... I found several answers, but for some reason they do not solve my goal ... Please suggest solutions.

+6
source share
2 answers

Give it a try.

You can do something like this to create a rounded edit box:

Create the stylesy.xml file in the values ​​folder.

<solid android:color="#FFFFFF"/> <stroke android:width="2dp" android:color="#E7E7E7" android:height="10dp"/> <corners android:radius="5dp"/> 

Then you can use it in xml, for example:

style = "@ style / Edit_box_background" other attributes ....

+4
source

Just to make the comments higher, clearer:

You must create the file in the drawings. for example: textinputborder.xml ..

Then add the following code for the shape and color of the frame to this file:

 <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="#00000000" /> <stroke android:width="2.5dp" android:color="#FFFFFF" /> <corners android:radius="5dp"/> </shape> 

Then use this form to edit the text widget inside the activity XML file as needed:

 <EditText android:id="@+id/searchBox" android:layout_width="fill_parent" android:layout_height="45dp" android:background="@drawable/textinputborder" android:hint="@string/Search" android:paddingLeft="10dp" android:inputType="textVisiblePassword" > </EditText> 
+32
source

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


All Articles