android - How to change editText hint postion -
can alter "hint" , text position (to rising center)
my xml follows:
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/layouttopblue" android:layout_width="fill_parent" android:layout_height="30dp" android:background="#4285f4" android:layout_below="@id/layouttopblack" > <edittext android:id="@+id/edittext1" android:layout_gravity="center" android:text='' android:hint="my hint" android:textcolorhint="#ffffff" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centervertical="true" android:layout_centerhorizontal="true" android:background="@drawable/edit" /> <imageview android:id="@+id/imageview1" android:layout_width="30dp" android:layout_height="30dp" android:layout_gravity="center" android:layout_centervertical="true" android:layout_alignleft="@+id/edittext1" android:src="@drawable/search" /> <imageview android:id="@+id/imageview1" android:layout_width="30dp" android:layout_height="30dp" android:layout_gravity="center" android:layout_centervertical="true" android:layout_alignright="@+id/edittext1" android:src="@drawable/cross" /> </relativelayout>
or maybe possible drawable edittext:
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item> <shape > <solid android:color="@color/editborder" /> </shape> </item> <!-- main color --> <item android:bottom="1.5dp" android:left="1.5dp" android:right="1.5dp"> <shape > <solid android:color="@color/editbackground" /> </shape> </item> <!-- draw block cut-off left , right bars --> <item android:bottom="5.0dp"> <shape > <solid android:color="@color/editbackground" /> </shape> </item> </layer-list>
any ideas please? thanks!
anyone can use
android:gravity="center|center_horizontal|center_vertical|top"
android android-layout android-edittext
No comments:
Post a Comment