edittext 的一个案例
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:myAndroid = "http://schemas.android.com/apk/res/cn.loyulcare.android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/bgcolor" android:orientation="vertical">" <TextView android:id = "@+id/tvMineInfoTitle" android:text="@string/mine_info" android:layout_marginTop="10dp" style = "@style/NurserDetailsTitleStyle"/> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" > <View android:layout_width="match_parent" android:layout_height="@dimen/divider_line_width" android:layout_marginTop="0dp" android:background="@color/divider_line_color" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/White" android:gravity="center_vertical" android:orientation="horizontal" android:paddingLeft="@dimen/layout_outline_padding" android:paddingRight="@dimen/layout_outline_padding" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingBottom="@dimen/text_padding" android:paddingRight="@dimen/text_padding" android:paddingTop="@dimen/text_padding" android:text="姓名" android:textColor="@color/bgcolor" android:textSize="@dimen/content_text_size" /> <EditText android:id="@+id/etName" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:background="@color/White" android:hint="@string/select_or_input_nickname" android:inputType="text" android:padding="@dimen/text_padding" android:textColor="@color/Black" android:textSize="@dimen/content_text_size" /> </LinearLayout> <View android:layout_width="match_parent" android:layout_height="@dimen/divider_line_width" android:background="@color/divider_line_color" /> </LinearLayout>