安卓好看的登录界面
来源:互联网 发布:淘宝大象排名查询 编辑:程序博客网 时间:2024/04/29 17:48
大家好,今天开始写我的第二篇博客,昨天简单写了下记住密码和显示密码,由于时间有限随便写了一下,今天有时间,给大家详细的写一下比较好看的登录界面。
跟往常一样,废话不多少,先上一张效果图吧
接下来先教大家弄一下这个渐变布局,喜欢别的颜色可以更改,在drawable里新建一个文件,代码如下:
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android"> <gradient android:startColor="#009393" android:endColor="#bbffbb" android:angle="90"/></shape>
然后开始写布局,布局就是一个简单的用线性布局包裹着的一个布局,直接粘上代码让大家看看吧:
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:background="@drawable/sha" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="账号登录" android:layout_gravity="center" android:layout_marginTop="85dp" android:textColor="#ffffff" android:textSize="30sp"/> <LinearLayout android:layout_width="match_parent" android:layout_height="40dp" android:orientation="horizontal" android:layout_marginLeft="60dp" android:layout_marginRight="60dp" android:layout_marginTop="15dp" android:background="#ffffff"> <EditText android:id="@+id/ed_name" android:layout_width="match_parent" android:layout_height="wrap_content" android:singleLine="true" android:layout_marginTop="10dp" android:layout_marginLeft="10dp" android:hint="请输入账号" android:textColorHint="#f0f0f0" android:background="@null"/> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="40dp" android:orientation="horizontal" android:layout_marginLeft="60dp" android:layout_marginRight="60dp" android:layout_marginTop="15dp" android:background="#ffffff"> <EditText android:id="@+id/ed_pass" android:layout_width="match_parent" android:layout_height="wrap_content" android:singleLine="true" android:layout_marginTop="10dp" android:layout_marginLeft="10dp" android:hint="请输入密码" android:inputType="textPassword" android:textColorHint="#f3f3f3" android:background="@null"/> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="40dp" android:orientation="horizontal" android:layout_marginLeft="60dp" android:layout_marginRight="60dp" android:layout_marginTop="15dp"> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <CheckBox android:id="@+id/ck_pass" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="记住密码" android:gravity="center" android:textColor="#ffffff"/> <CheckBox android:id="@+id/ck_xian" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:text="显示密码" android:gravity="center" android:textColor="#ffffff"/> <TextView android:id="@+id/tv_name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#ffffff" android:gravity="center" android:layout_marginTop="8dp" android:layout_alignParentRight="true" android:text="注册账号"/> </RelativeLayout> </LinearLayout> <Button android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="65dp" android:layout_marginRight="65dp" android:layout_marginTop="15dp" android:background="#009393" android:text="登录" android:onClick="log" android:textColor="#ffffff" android:textSize="20sp"/></LinearLayout>
好了,写到这里你就可以运行一下自己的应用,就会发现你也有这样的登录界面,注明一点:最外层的线性布局的背景就是最开始咱们写的那个文件,引用一下就好了,欢迎大家在这里相互交流。
阅读全文
0 0
- 安卓好看的登录界面
- 安卓学习笔记---好看的UI界面
- 好看的H5登录界面 动态云
- 一步一步开发安卓应用 登录界面的功能 (LoginActivity)
- 好看的程序设置界面
- 设置好看的eclipse界面
- 简单安卓QQ登录界面
- 安卓注册登录界面示例
- 安卓实现个性彩色好看的二维码
- 安卓日记——设计简洁好看的UI
- 安卓登录界面让输入框滚动到指定位置的方法
- 安卓实现电脑端的QQ登录界面 自动提示+点击按钮提示输入记录
- 安卓界面-缓冲界面的用法
- 安卓_登录界面/信息框中删除键
- 安卓_登录界面短信验证码
- 安卓开发视频背景登录界面实现
- 安卓界面布局的一些基本知识
- 安卓应用的界面编程
- css隐藏问题
- CCF 201703-4 地铁修建 Java
- 机器学习的一些基本概念
- 客制化开机Logo
- react-router 4.2版本的升级
- 安卓好看的登录界面
- 阿里云 CDN HTTPS 最佳实践——TLS record size(五)
- Java发生方法覆盖的条件
- Nginx启动报错: could not open error log file: open()
- 推荐一款js脚本预加载的插件
- UI自动化测试框架(项目实战)python、Selenium(日志、邮件、pageobject)
- redis数据类型详解
- 蓝桥杯 算法提高 8-1因式分解(Java解题)
- IIS Express 使用记录