<Button
android:id=“@+id/button2”
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:layout_weight=“1”
android:visibility=“gone” //gone 表示控件不可见,也不会占任何的位置,也不会有任何响应。
android:text=“button2”>
<Button
android:id=“@+id/button3”
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:layout_weight=“1”
android:text=“button3”>
效果如图:
学习过HTML的都会知道CSS里的盒模式有个外边距和内边距。
外边距可以设置视图距离父视图上下左右的距离。
内边距可以设置视图内部内容距离自己边框上下左右的距离。
Android 的控件布局其实也用的是这个盒模式。
如果距离父视图上下左右的外边距相同,可以这么设置:
android:layout_margin=“10dp”
我们也可以单独的设置某个外边距:
android:layout_marginTop=“10dp”
android:layout_marginBottom=“10dp”
android:layout_marginLeft=“10dp”
android:layout_marginRight=“10dp”
统一设置上下左右内边距:
android:padding=“5dp”
各自设置内边距:
android:paddingTop=“5dp”
android:paddingBottom=“5dp”
android:paddingLeft=“5dp”
android:paddingRight=“5dp”
====================================================================================
LinearLayout 核心属性:
(1) android:orientation:两个属性值:“vertical” 垂直 “horizontal”水平
(2) android:layout_weight 将父控件的剩余空间按照设置的权重比例再分配
<LinearLayout
android:id=“@+id/linearLayout”
android:layout_width=“match_parent”
android:layout_height=“wrap_content”
android:orientation=“horizontal”
app:layout_constraintEnd_toEndOf=“parent”
app:layout_constraintStart_toStartOf=“parent”
app:layout_constraintTop_toTopOf=“parent”>
<Button
android:id=“@+id/button1”
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:text=“button1”>
<Button
android:id=“@+id/button2”
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:text=“button2”>
<Button
android:id=“@+id/button3”
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:text=“button3”>
<LinearLayout 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:orientation=“vertical”
android:layout_height=“match_parent”
tools:context=“.MainActivity”>
<TextView
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:text=“×”
android:textSize=“50dp”
android:layout_marginLeft=“5dp”/>
<TextView
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:layout_marginLeft=“20dp”
android:layout_marginTop=“5dp”
android:text=“微信号/QQ/邮箱登录”
android:textColor=“@color/black”
android:textSize=“30dp”/>
<LinearLayout
android:layout_width=“match_parent”
android:layout_height=“wrap_content”
android:layout_marginTop=“30dp”>
<LinearLayout
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:layout_weight=“1”
android:layout_marginTop=“6dp”
android:orientation=“horizontal”>
<TextView
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:layout_marginLeft=“25dp”
android:text=“账号”
android:textColor=“@color/black”
android:textSize=“25dp” />
<LinearLayout
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:layout_weight=“0”>
<EditText
android:layout_width=“wrap_content”
android:layout_height=“match_parent”
android:text="请填写微信号/QQ号/邮箱 "/>
<LinearLayout
android:layout_width=“match_parent”
android:layout_height=“45dp”
android:layout_marginTop=“10dp”
android:orientation=“horizontal”>
<LinearLayout
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:layout_weight=“1”>
<TextView
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:layout_marginLeft=“25dp”
android:text=“密码”
android:textColor=“@color/black”
android:textSize=“25dp” />
<LinearLayout
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:layout_weight=“0”>
<EditText
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:text="请填写密码 "/>
<TextView
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:text=“用手机号登录”
android:layout_marginTop=“20dp”
android:layout_marginLeft=“25dp”
android:textSize=“20dp”
android:textColor=“@color/purple_500”/>
<Button
android:layout_width=“match_parent”
android:layout_height=“wrap_content”
android:text=“登录”
android:textSize=“30dp”
android:layout_marginTop=“30dp”
/>
<LinearLayout
android:layout_width=“match_parent”
android:layout_height=“wrap_content”
android:layout_marginTop=“150dp”
android:orientation=“horizontal”>
<LinearLayout
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:layout_weight=“2”>
<TextView
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:text=“找回密码”
android:layout_marginLeft=“80dp”
android:textColor=“@color/purple_500”
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。
深知大多数初中级Android工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则近万的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年Android移动开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Android开发知识点,真正体系化!
由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!
如果你觉得这些内容对你有帮助,可以扫码获取!!(备注:Android)
![](https://i-blog.csdnimg.cn/blog_migrate/8bb570d3b881a14482326a82932db506.jpeg)
最后
针对于上面的问题,我总结出了互联网公司Android程序员面试涉及到的绝大部分面试题及答案,并整理做成了文档,以及系统的进阶学习视频资料。
(包括Java在Android开发中应用、APP框架知识体系、高级UI、全方位性能调优,NDK开发,音视频技术,人工智能技术,跨平台技术等技术资料),希望能帮助到你面试前的复习,且找到一个好的工作,也节省大家在网上搜索资料的时间来学习。
《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!
比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!**
如果你觉得这些内容对你有帮助,可以扫码获取!!(备注:Android)
![](https://i-blog.csdnimg.cn/blog_migrate/8bb570d3b881a14482326a82932db506.jpeg)
最后
针对于上面的问题,我总结出了互联网公司Android程序员面试涉及到的绝大部分面试题及答案,并整理做成了文档,以及系统的进阶学习视频资料。
(包括Java在Android开发中应用、APP框架知识体系、高级UI、全方位性能调优,NDK开发,音视频技术,人工智能技术,跨平台技术等技术资料),希望能帮助到你面试前的复习,且找到一个好的工作,也节省大家在网上搜索资料的时间来学习。
[外链图片转存中…(img-tZ45QLCb-1712370778250)]
《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!