How to make a yellow frame around EditText
?
And then how to change the color of this frame? :)
Here is the yellow frame:
How to make a yellow frame around EditText
?
And then how to change the color of this frame? :)
Here is the yellow frame:
as I understand you need it
Create the EditTextStyle.xml file in the drawable folder
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:thickness="0dp" android:shape="rectangle"> <stroke android:width="3dp" android:color="#4799E8"/> <corners android:radius="5dp" /> <gradient android:startColor="#C8C8C8" android:endColor="#FFFFFF" android:type="linear" android:angle="270"/> </shape>
Add an attribute to EditText android:background="@drawable/EditTextStyle"
<EditText android:id="@+id/inputSearchEditText" android:layout_marginLeft="15dp" android:layout_marginTop="15dp" android:layout_marginBottom="20dp" android:layout_marginRight="15dp" android:layout_centerVertical="true" android:layout_width="match_parent" android:layout_height="wrap_content" android:ellipsize="start" android:gravity="center" android:hint="Search text" android:inputType="text" android:background="@drawable/EditTextStyle"/>
should help ( in English )
UPD:
And then how to change the color of this frame? :)
change these lines
... <stroke android:width="3dp" android:color="#4799E8"/> ... android:startColor="#C8C8C8" android:endColor="#FFFFFF" ...
UPD 2:
How to increase the indent of the blue frame from the text? It fits tight
for this you need to add padding
to EditText
<EditText android:paddingLeft="10dp" android:paddingRight="10dp" android:paddingTop="10dp" android:paddingBottom="10dp" ...
android:padding="8dp"
- Saidolim<EditText android:paddingLeft="10dp" android:paddingRight="10dp" android:paddingTop="10dp" android:paddingBottom="10dp"
- SaidolimSource: https://ru.stackoverflow.com/questions/459192/
All Articles
В Eclipse у меня она появлялась автоматически
- the development environment does not affect the appearance of the application, the difference may be due to different target versions of theAndroid API
- ermak0ff