Customize Android EditText

痞子三分冷 提交于 2019-12-08 06:09:20

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!