Can I change the line color on EditText. When is active it has some greenish color.
Is it possible to change only the color of line when is active, and how can I do this...?
Can I change the line color on EditText. When is active it has some greenish color.
Is it possible to change only the color of line when is active, and how can I do this...?
You need to set background source for an edit text.
android:background="@drawable/my_theme_edit_text" for the custom EditText. Or you can set that background in your app theme - you will find example in .zip file from that siteYou can set background of edittext to a rectangle with minus padding on left, right and top to achieve this.
Here is the xml example for setting different line colors for focused and not focused edittext, just set it as background of edittext.
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:top="-2dp" android:left="-2dp" android:right="-2dp" android:bottom="2dp"> <selector > <item android:state_enabled="true" android:state_focused="true"> <shape android:shape="rectangle"> <stroke android:width="2dp" android:color="#6A9A3A"/> </shape> </item> <item android:state_enabled="true"> <shape android:shape="rectangle"> <stroke android:width="1dp" android:color="#000000"/> </shape> </item> </selector> </item> </layer-list> <EditText android:id="@+id/editText1" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" android:background="@drawable/text" android:ems="10" android:textColorHint="#fefefe" android:hint="@string/text1" android:textColor="#fefefe" android:inputType="textEmailAddress" android:layout_marginTop="10dp" /> Use the below code in your res/drawable/text.xml
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:top="24.0dp"> <shape > <solid android:color="#fefefe" /> </shape> </item> </layer-list>