android中自己画一个按钮,和自己设置一个框框
16lz
2021-01-24
效果图
自己画这个登录这个按钮,和自己画手机注册这个框框
自己画一个按钮
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" > <corners android:radius="50dp" /> <solid android:color="#FF1493" />shape>
自己画一个框框
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" > <solid android:color="@android:color/transparent" /> <corners android:radius="1dip" /> <stroke android:width="2px" android:color="#ccC71485" />shape>
xml页面
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/white" android:orientation="vertical" > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/top1" > LinearLayout> <TableLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" > <TableRow> <TextView android:text="账号:" /> <EditText android:layout_weight="1" android:background="@null" android:hint="手机号/邮箱" android:text="" /> TableRow> <TableRow> <View android:layout_width="match_parent" android:layout_height="2dp" android:layout_margin="5dp" android:layout_weight="1" android:background="@android:color/darker_gray" /> TableRow> <TableRow> <TextView android:text="密码:" /> <EditText android:layout_weight="1" android:background="@null" android:hint="登录密码" android:text="" /> TableRow> <TableRow> <Button android:layout_width="wrap_content" android:layout_height="40dp" android:layout_weight="1" android:background="@drawable/shape" android:text="登录" android:textColor="@android:color/white" /> TableRow> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:text="忘记密码?" android:textSize="10sp" /> RelativeLayout> TableLayout> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:orientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="还没有账号?" /> <Button android:layout_width="wrap_content" android:layout_height="30dp" android:background="@drawable/shape1" android:text="手机注册" android:textColor="#FF1493" android:textStyle="bold" /> LinearLayout>LinearLayout>
更多相关文章
- Android中为按钮设置点击音效
- android studio 导入eclipse项目 兼容性问题
- Android如何设置圆角按钮 类似微信的登陆按钮
- Android(安卓)强制下线功能 第一行代码
- android studio基础教程:3.美化按钮
- Android(安卓)Intent参数传递
- 安卓 隐藏按钮
- Android简单明了的使用属性动画ObjectAnimator 旋转 平移 渐变
- Android动画播放的常用方式