标签:QQ 控件 vue layout 绑定 height content android id
==============================================================
在构建UI界面时不要着急动手,首先要考虑准备哪些素材
《Android学习笔记总结+最新移动架构视频+大厂安卓面试真题+项目实战源码讲义》
【docs.qq.com/doc/DSkNLaERkbnFoS0ZF】 完整内容开源分享
(如:图片资源),会用到哪些控件,把步骤想清楚再动手实践,养成良好的编程习惯在以后开发中会有很大帮助。现在先来看一下QQ登录界面,预览效果如下图所示。
从图中可以看出,该界面需要一张图片作为QQ头像,因此找到1张图片(head.png)放在drawable文件夹中。
然后分析该界面组成部分,从整体来看界面可分为三部分,第一部分放置1个ImageView控件用于显示头像。
第二部分使用两个水平的线性布局,每个水平布局放置1个TextView控件和1个EditText控件,分别用于显示标题和输入内容。
第三部分放置1个Button按钮用于实现登录。
总的布局是RelativeLayout
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android=“http://schemas.android.com/apk/res/android”
xmlns:app=“http://schemas.android.com/apk/res-auto”
xmlns:tools=“http://schemas.android.com/tools”
android:layout_width=“match_parent”
android:layout_height=“match_parent”
tools:context=".MainActivity"
android:orientation=“vertical”>
第一部分的ImageView控件用来存放QQ头像
<ImageView
android:id="@+id/iv"
android:layout_width=“70dp”
android:layout_height=“70dp”
android:layout_centerHorizontal=“true”
android:layout_marginTop=“40dp”
android:background="@drawable/head"/>
第二部分使用两个水平的线性布局,每个水平布局有1个TextView控件和1个EditView控件,分别用来显示标题和输入内容
<LinearLayout
android:id="@+id/ll_number"
android:layout_width=“match_parent”
android:layout_height=“wrap_content”
android:layout_below="@+id/iv"
android:layout_centerHorizontal=“true”
android:layout_marginBottom=“5dp”
android:layout_marginLeft=“10dp”
android:layout_marginRight=“10dp”
android:layout_marginTop=“15dp”
android:background="#ffffff">
<TextView
android:id="@+id/tv_number"
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:padding=“10dp”
android:text=“账号:”
android:textColor="#000"
android:textSize=“20sp”/>
<EditText
android:id="@+id/et_number"
android:layout_width=“match_parent”
android:layout_height=“wrap_content”
android:layout_marginLeft=“5dp”
android:background="@null"
android:padding=“10dp”/>
<LinearLayout
android:id="@+id/ll_password"
android:layout_width=“match_parent”
android:layout_height=“wrap_content”
android:layout_below="@+id/ll_number"
android:layout_centerVertical=“true”
android:layout_marginLeft=“10dp”
android:layout_marginRight=“10dp”
android:background="#ffffff">
<TextView
android:id="@+id/tv_password"
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:padding=“10dp”
android:text=“密码:”
android:textColor="#000"
android:textSize=“20sp”/>
<EditText
android:id="@+id/et_password"
android:layout_width=“match_parent”
android:layout_height=“wrap_content”
android:layout_marginLeft=“5dp”
android:layout_toRightOf="@id/tv_password"
标签:QQ,控件,vue,layout,绑定,height,content,android,id 来源: https://blog.csdn.net/k186____5189/article/details/122199018
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。