问题
Is there a way that I can customize the android EditText just like the image below? Thanks.
回答1:
Try This
<LinearLayout android:layout_height="wrap_content"
android:layout_width="match_parent" android:background="@color/front_white"
android:orientation="vertical">
<EditText android:layout_height="35dip" android:layout_width="fill_parent"
android:id="@+id/editText1" android:background="@color/front_white"
android:hint="Email Address"></EditText>
<TextView android:layout_height="1dip" android:layout_width="fill_parent"
android:background="@color/dark_gry" />
<EditText android:layout_height="35dip" android:layout_width="fill_parent"
android:id="@+id/editText2" android:background="@color/front_white"
android:hint="Re-enter"></EditText>
</LinearLayout>
I hope it is what you are looking for..
回答2:
I think a good way to handle with this, is to create a background image for the activity. Than, after that, you can position two EditText-Widgets over that. Only set the EditText-Widgets to 100% Transparent. (How to Set Transparent? See this question: Android EditText Transparent Background).
回答3:
I think in your layout you can put 2 edit text and a picture so you will have a layout that will have background a picture and after to esit box
回答4:
Yes. Set the background of the Linear/Relative or whatever layout your using to hold the EditTexts to the silver image.
Add the EditText and set the background to transparent in color. Add a text hint with what you want.
Add another image view with the border.
回答5:
in xml file use this property
android:drawableBottom="@drawable/ic_launcher"
来源:https://stackoverflow.com/questions/7316214/customize-android-edittext