Android:布局实例之模仿京东登录界面
预览图及布局结构参考:

布局:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffF6F2ED" > <LinearLayout
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_alignParentTop="true"
android:background="@drawable/android_title_bg"
android:gravity="center_vertical"
android:orientation="horizontal" > <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:singleLine="true"
android:text="@string/login"
android:textColor="@android:color/white"
android:textSize="15sp" />
</LinearLayout> <ScrollView
android:id="@+id/login_scroller"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/title" > <RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" > <ImageView
android:id="@+id/joy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:minHeight="75dp"
android:minWidth="75dp"
android:padding="3dp"
android:src="@drawable/login_dog" /> <LinearLayout
android:id="@+id/login_edit_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/joy"
android:layout_marginLeft="13dp"
android:layout_marginRight="13dp"
android:background="@drawable/login_layout_editor_bg"
android:orientation="vertical" > <LinearLayout
android:layout_width="match_parent"
android:layout_height="47dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:gravity="center_vertical"
android:orientation="horizontal" > <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="@string/user_name"
android:textColor="@android:color/black"
android:textSize="17sp" /> <EditText
android:id="@+id/login_input_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:background="#fffbfbfb"
android:singleLine="true" />
</LinearLayout> <View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#ffc8c8c8" /> <LinearLayout
android:layout_width="match_parent"
android:layout_height="47dp"
android:gravity="center_vertical"
android:orientation="horizontal" > <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="@string/user_password"
android:textColor="@android:color/black"
android:textSize="17sp" /> <EditText
android:id="@+id/login_input_password"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#fffbfbfb"
android:inputType="textPassword"
android:singleLine="true" /> <CheckBox
android:id="@+id/login_switchBtn"
android:layout_width="55dp"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:button="@drawable/login_hide_password_selector"
android:clickable="true" />
</LinearLayout>
</LinearLayout> <Button
android:id="@+id/login_btn"
android:layout_width="match_parent"
android:layout_height="42dp"
android:layout_below="@+id/login_edit_layout"
android:layout_marginLeft="13dp"
android:layout_marginRight="13dp"
android:layout_marginTop="13dp"
android:background="@drawable/login_layout_btn_bg"
android:text="@string/login"
android:textColor="@android:color/white"
android:textSize="15sp" /> <RelativeLayout
android:id="@+id/login_passfind_and_phonelogin"
android:layout_width="match_parent"
android:layout_height="20dp"
android:layout_below="@+id/login_btn"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="13dp"
android:gravity="center_vertical" > <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="@string/find_password"
android:textColor="#ff288dfe"
android:textSize="15sp" /> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="@string/phone_register"
android:textColor="#ff288dfe"
android:textSize="15sp" />
</RelativeLayout> <RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/login_passfind_and_phonelogin"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="13dp"
android:gravity="center_vertical" > <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:drawableLeft="@drawable/login_icon_wx"
android:drawablePadding="5dp"
android:drawableRight="@drawable/index_icon1"
android:gravity="center_vertical"
android:text="@string/weixin_login"
android:textColor="#ff787878"
android:textSize="15sp" /> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:drawableLeft="@drawable/login_icon_other"
android:drawablePadding="5dp"
android:drawableRight="@drawable/index_icon1"
android:gravity="center_vertical"
android:text="@string/other_login"
android:textColor="#ff787878"
android:textSize="15sp" />
</RelativeLayout>
</RelativeLayout>
</ScrollView>
</RelativeLayout>
这次学习到的
文本框添加背景色可以取消掉默认背景
EditText父级加入以下属性,可以取消默认聚焦
android:gravity="center_vertical"
android:orientation="horizontal"
让文本单行显示的属性:
android:singleLine="true"
TextView添加图标可以用
android:drawableLeft="@drawable/login_icon_wx"
相关文章:
Android:布局实例之模仿京东登录界面的更多相关文章
- [转]Android:布局实例之模仿QQ登录界面
Android:布局实例之模仿QQ登录界面 预览图: 准备: 1.找到模仿对象 QQ登陆界面UI下载>>>>> 2.导入工程 3.查看布局结构和使用控件 其对应效果图分布 ...
- Android:布局实例之模仿QQ登录界面
预览图: 准备: 1.找到模仿对象 QQ登陆界面UI下载>>>>> 2.导入工程 3.查看布局结构和使用控件 其对应效果图分布为 4.分析样式选择器 下拉箭头2种样式:点 ...
- java代码完全手写模仿qq登录界面
这是我模仿QQ2015版界面,实现的基本功能有登陆验证,重置等,当然直接复制代码运行是不一样的,还要注意自己插入自己的图片. 结果截图如下所示: import java.awt.BorderLayou ...
- Android:布局实例之模仿微信Tab
微信Tab预览效果: 思路: 1.用TabHost+RadioGroup搭建基本布局,以RadioGroup代替TabWidget 2.设置按钮和文字的的样式和selector 3.创建相应的Acti ...
- Android:布局实例之常见用户设置界面
实现效果: 整理思路: 1.控件:文字TextView 和 右箭头ImageView 2.因为考虑到点击效果,设计为:最外层为全圆角,内层有四种情况,分别为上圆角.无圆角.下圆角和全圆角. 3.内层样 ...
- 微信小程序相关一、模仿京东静态登录页面
一.培训的第一天,基本上没有什么最新的东西,但是看到老师的代码收获的确实是不少. 1.1.首页代码很简洁,将共有的样式都提取的很好. 1.2.其次是每一个小块写样式的时候用到了好多子代选择器和后代选择 ...
- Android开发实例之miniTwitter登录界面的实现
原文: http://www.jizhuomi.com/android/example/134.html 本文要演示的Android开发实例是如何完成一个Android中的miniTwitter登录界 ...
- Android基础总结(3)——UI界面布局
Android的UI设计有好几种界面程序编写方式.大体上可分为两大类:一类是利用可视化工具来进行,允许你进行拖拽控件来进行布局:还有一类是编写xml文档来进行布局.这两种方法可以相互转换. 1.常见的 ...
- android内部培训视频_第五节(1)_OA实战之登录界面
第五节(1):OA实战之登录界面 一.登录界面布局 1.背景图片 2.文本框 3.checkbox 4.按钮 暂未实现点击切换图片效果 <RelativeLayout xmlns:androi ...
随机推荐
- 写个dump_stack【转】
转自:http://blog.chinaunix.net/uid-27714502-id-3434761.html 简单实现dump_stack 0.首先确保你能写个内核模块:打印"hell ...
- [转载]关于python字典类型最疯狂的表达方式
一个Python字典表达式谜题 让我们探究一下下面这个晦涩的python字典表达式,以找出在python解释器的中未知的内部到底发生了什么. # 一个python谜题:这是一个秘密 # 这个表达式计算 ...
- 1438. Shopaholic
Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description Lindsay is a shopaholic. Whenever th ...
- 设计模式之笔记--工厂方法模式(Factory Method)
工厂方法模式(Factory Method) 定义 工厂方法模式(Factory Method),定义一个用于创建对象的接口,让子类决定实例化哪一个类.工厂方法使一个类的实例化延迟到其子类. 类图 描 ...
- 实现atoi函数
atoi函数最关键的地方是想好测试用例: 输入为空字符串,输出为0; 输入字符串大小超过INT_MAX输出INT_MAX; 输入字符串大小小于INT_MIN输出INT_MIN; 输入字符串中含有不规则 ...
- .NET Core、.NET Standard、Xamarin和.NET Framework对比
近日,微软发布了.NET Core 2.0,但是开发人员中间仍然存在一些疑惑,就是.NET Core..NET Standard.Xamarin和.NET Framework有什么不同. .NET F ...
- php设计模式四 ---- 原型模式
1.简介 用于创建重复的对象,同时又能保证性能.这种类型的设计模式属于创建型模式,它提供了一种创建对象的最佳方式 意图:用原型实例指定创建对象的种类,并且通过拷贝这些原型创建新的对象. 主要解决:在运 ...
- CF1064 E - Dwarves, Hats and Extrasensory Abilities
题意 交互题, 本来应该是在平面上进行的. 实际上换成一条直线就可以, 其实换成在平面上更复杂一些. Solution 假设\(l\)点是黑点, \(r\)处是白点, 那么就把下一个点的位置放置在\( ...
- 生成RSA2公钥、私钥
RSA2是一种被使用广泛的非对称加密算法. openssl OpenSSL> genrsa -out app_private_key.pem # 私钥RSA2 OpenSSL> rsa - ...
- mac date 和 Linux date实现从指定时间开始循环
Linux date begin="2016-01-01" ; i < ; i++ )); do current=$(date -d "$i day $begin& ...