线性布局案例(2)
2016-04-12 16:53
169 查看
效果图
activity_main.xml:
<LinearLayout
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:divider="@drawable/separator"
android:padding="10dp"
android:orientation="vertical"
tools:context=".MainActivity"
>
<EditText
android:id="@+id/etName"
android:hint="请输入注册的用户名"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
>
<requestFocus
/>
</EditText>
<EditText
android:id="@+id/etPassword"
android:hint="请输入密码"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPassword"
/>
<EditText
android:id="@+id/etConfirmPassword"
android:hint="请再次输入密码"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPassword"
/>
<EditText
android:id="@+id/etEmail"
android:hint="请输入邮箱"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textEmailAddress"
/>
<EditText
android:id="@+id/etPhone"
android:hint="请输入电话号码"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="phone"
/>
<Button
android:id="@+id/btnRegist"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="@drawable/btn_bg"
android:text="注册"
/>
</LinearLayout>
<?xml
version="1.0"encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
>
<gradient
android:angle="90"
android:endColor="#ffffff"
android:startColor="#0000ff"
android:type="linear"
/>
<corners
android:radius="10dp"
/>
</shape>
activity_main.xml:
<LinearLayout
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:divider="@drawable/separator"
android:padding="10dp"
android:orientation="vertical"
tools:context=".MainActivity"
>
<EditText
android:id="@+id/etName"
android:hint="请输入注册的用户名"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
>
<requestFocus
/>
</EditText>
<EditText
android:id="@+id/etPassword"
android:hint="请输入密码"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPassword"
/>
<EditText
android:id="@+id/etConfirmPassword"
android:hint="请再次输入密码"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPassword"
/>
<EditText
android:id="@+id/etEmail"
android:hint="请输入邮箱"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textEmailAddress"
/>
<EditText
android:id="@+id/etPhone"
android:hint="请输入电话号码"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="phone"
/>
<Button
android:id="@+id/btnRegist"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="@drawable/btn_bg"
android:text="注册"
/>
</LinearLayout>
<?xml
version="1.0"encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
>
<gradient
android:angle="90"
android:endColor="#ffffff"
android:startColor="#0000ff"
android:type="linear"
/>
<corners
android:radius="10dp"
/>
</shape>
相关文章推荐
- 隐藏ion-nav-back-button的文字
- 实验:C++实验3-项目1
- Linux常用命令大全
- [PHP实例] 使用PHPZip解压缩文件
- Java线程池的那些事
- Spring MVC让Web容器启动时自动执行代码
- Cocos2dx 3.x 新建项目编译很慢的解决方案
- 小莫-公开课编辑稿
- 继承虚函数&数组名做参数
- centos 安装jdk
- 欧拉函数
- iOS中的initialize与load两个类方法简单理解
- UITextField的总结
- NDK开发之c++调用java
- G711编解码(G711与PCM类型互转)
- 工厂模式(2)
- android Home键监听
- (视图)初步学习
- 算法模型大全
- app审核提交 注意事项