Android之十一实现登陆页面分析
来源:互联网 发布:淘宝商品如何做图 编辑:程序博客网 时间:2024/05/16 09:24
Android之十一实现登陆页面分析
二、登录界面的布局分析
1、login.xml
Step1:首先建立drawable 文件夹,创建logintopbg_roundcorner.xml
Step1:首先建立drawable 文件夹,创建logintopbg_roundcorner.xml
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" > <solid android:color="#55ffffff"/><corners android:radius="15dp"/></shape>Step2:创建btn_select.xml
<?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android" > <item android:drawable="@drawable/btn_shape" android:state_pressed="false"></item> <item android:drawable="@drawable/btn_shape_after" android:state_pressed="true"></item></selector>其中btn_shape.xml 文件和btn_shape_after.xml 文件如下
btn_shape.xml
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" > <solid android:color="#ff72CAE1"/> <corners android:radius="10dp"/></shape>btn_shape_after.xml
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" > <solid android:color="#87cefa"/> <corners android:radius="10dp"/></shape>Step3:定义login_tio.xml 文件,布局如下
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:background="@drawable/logintopbg_roundcorner" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".Loginactivity" ><EditText android:id="@+id/tdName" android:drawableLeft="@drawable/icons_user_img" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:ems="10" android:background="@android:drawable/edit_text" android:drawablePadding="10dp" android:hint="@string/etName" /><EditText android:id="@+id/tdPassword" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:layout_marginTop="62dp" android:background="@android:drawable/edit_text" android:drawableLeft="@drawable/icons_password_img" android:drawablePadding="10dp" android:hint="@string/etPassword" android:ems="10" /><LinearLayout android:layout_width="match_parent" android:layout_height="50dp" android:layout_below="@id/tdPassword" > <Button android:id="@+id/button1" android:layout_width="50dp" android:layout_height="50dp" android:layout_weight="1" android:background="@drawable/btn_select" android:text="@string/btnlogin" /> <Button android:id="@+id/button2" android:layout_width="50dp" android:layout_height="50dp" android:background="@drawable/btn_select" android:layout_weight="1" android:layout_marginLeft="5dp" android:text="@string/btnRegister" /> </LinearLayout></RelativeLayout>
activity_main.xml
<span style="font-size:18px;"><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/btn_shape" tools:context=".MainActivity" > <ImageView android:id="@+id/imageView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:layout_marginBottom="34dp" android:layout_marginRight="27dp" android:src="@drawable/monkey" /> <LinearLayout android:id="@+id/tt" android:layout_width="wrap_content" android:layout_height="wrap_content"> </LinearLayout> <TextView android:id="@+id/textView1" android:layout_width="80dp" android:layout_height="30dp" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:text="@string/etPassword2" /> <include android:id="@+id/include1" android:layout_width="294dp" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" layout="@layout/login_top" /></RelativeLayout></span>
0 0
- Android之十一实现登陆页面分析
- Android之实现登陆页面分析
- Android 学习笔记之十一 2048的实现分析
- Android核心分析 之十一-------Android GWES之消息系统
- Android核心分析 之十一-------Android GWES之消息系统
- Android核心分析 之十一-------Android GWES之消息系统 .
- Android核心分析 之十一-------Android GWES之消息系统
- QQ登陆页面实现
- response实现案例之 重定向(登陆页面)
- Android登陆页面,获取验证码按钮的实现
- 登陆页面 监听enter 实现登陆
- Android 登陆页面 记住密码和自动登陆的简单实现
- 简单的实现页面登陆
- swift 实现一个登陆页面
- 安卓之登陆页面
- android 简单登陆页面
- Android开发-UI控件:实现登陆页面并跳转和简单的注册页面
- android:versionCode、android:versionName之实现第一次登陆、版本更新
- Linux C++学习之路
- 你是否恰当地使用了枚举------强烈建议对枚举进行显式赋值
- C++ explicit关键字
- linux下C++开发工具
- 并查集初学(2)LA 3644 & LA3027
- Android之十一实现登陆页面分析
- Linux下常用的C/C++开源Socket库
- map同步数据库/后台缓存
- Android5.1系统WebView内存泄漏场景
- Hash Compared & ELFHash 详解
- 桌面图标没有是解决方法windown
- 3D 游戏控制
- Spark中的各种action算子操作(java版)
- 对优秀程序员的思考