设置TextView的中划线
text.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG);设置圆角边框
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" > <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/yj" android:orientation="horizontal" android:gravity="center" > <ImageView android:id="@+id/imageView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@mipmap/ic_launcher" /> <EditText android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@null" android:hint="搜索" /> </LinearLayout> </LinearLayout>
------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <!-- 设置边框颜色和宽度--> <stroke android:color="#000" android:width="3dp" /> <!-- 设置圆角大小--> <corners android:bottomLeftRadius="20dp" android:topLeftRadius="20dp" android:topRightRadius="20dp" android:bottomRightRadius="20dp" ></corners> <!-- 设置内容与边框的距离--> <padding android:bottom="10dp" android:right="50dp" android:left="10dp" android:top="10dp" ></padding> </shape>
输入框
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="20dp" android:layout_marginTop="45dp" android:orientation="horizontal"> <ImageView android:layout_width="13.3dp" android:layout_height="20dp" android:src="@drawable/mine" /> <EditText android:id="@+id/pwd" android:layout_width="300dp" android:layout_height="20dp" android:layout_marginLeft="10.7dp" android:background="@null" android:hint="请输入密码" android:textColorHint="#999999" android:inputType="phone" android:textSize="14sp" /> <ImageView android:layout_width="13.3dp" android:layout_height="20dp" android:src="@drawable/shopcar"/> </LinearLayout> <TextView android:layout_width="340dp" android:layout_height="1dp" android:layout_marginLeft="20dp" android:background="#CFCFCF" />