android的五大布局

View与ViewGroup

View的属性:
1. 控件的宽高:(固定值 与两种状态)

android:layout_width="30dp"
android:layout_height="30dp"
android:layout_height="wrap_content"//随着内容的大小而变化
android:layout_height=“match_parent”//占满父窗体

2. 控件的可见度:(3种状态)

android:visibility="visible"//可见 
    ="gone"  //不可见
    ="invisible" //不可见
    //gone真实不可见也不占据位置    invisible不可见但占位置

3. 控件的背景:(颜色 图片)

android:background="#F00"

4. 盒子模型:

android:layout_margin="10dp"
android:padding="5dp"

 

5. 点击事件:

android:onClick="haha"


颜色值:颜色值基本有四种表现方式 (0表示在某个通道的颜色成分为空  F表示某个颜色通道为100%)
RGB(红绿蓝): #000~#FFF 
ARGB(透明度+红绿蓝):  #0000~#FFFF
RRGGBB:  #000000~#FFFFFF
AARRGGBB:  #00000000~#FFFFFFFF

View与ViewGroup的关系:
1. View表示控件  View与View之间是无法嵌套
2. 为了让控件能够嵌套其他控件 才产生了ViewGroup
3. ViewGroup的继承关系 ViewGroup一般比较少使用 我们一般使用其子类实现。


View

--ViewGroup    //布局
----AbsoluteLayout
----FrameLayout
----LinearLayout
----TableLayout
----RelativeLayout

LinearLayout

LinearLayout: 线性布局指的是该布局下包含的子布局列表为横线或者竖线排布。

重要属性:
指定方向:(横向布局/纵向布局)  android:orientation=""   //一个是    横向  一个是   纵向  横向(vertical)  纵向(horizontal)
权重:android:layout_weight=""  (只能在LinearLayout的子控件中使用)
权重:android:layout_weight="" 除去了整体其他带实际宽/高的一个比例

 

RelativeLayout

RelativeLayout: 相对布局 (相对父控件布局 相对兄弟控件布局)

针对父控件

android:layout_centerHorizontal 横向居中
android:layout_centerVertical   纵向居中
android:layout_centerInParent   横向纵向居中

跟父控件顶部/底部/最左边/最右边对齐

android:layout_alignParentTop 
android:layout_alignParentBottom 
android:layout_alignParentLeft 
android:layout_alignParentRight

针对已存在的兄弟控件(在某个控件的上面/下面/左边/右边)

android:layout_above  ="按钮的ID"  //android:layout_above="@+id/but_center"
android:layout_below 
android:layout_toLeftOf 
android:layout_toRightOf

相对兄弟控件的边对齐

android:layout_alignTop ="按钮的ID"
android:layout_alignTop="@+id/but_center"
android:layout_alignBottom
android:layout_alignLeft

android:layout_alignRight

FrameLayout

FrameLayout: 帧布局  越是后面写的控件越在顶层 (应用场景: 霓虹灯 自定义一些高级的UI控件) 层层叠加     重叠效果

其他组视图

AbsoluteLayout

AbsoluteLayout :绝对布局 控件在父控件中的绝对定位   (应用场景: 机顶盒开发 )

android:layout_x="30dp"
android:layout_y="30dp"

TableLayout

TableLayout: 表格布局 (应用场景: 银行表格)

<TableLayout />   表格标签
<TableRow />   表格行标签 该标签可以不使用

Android五大布局

View    //表示视图 
--ViewGroup    //视图布局
----AbsoluteLayout    //绝对布局
----FrameLayout        //帧布局
----LinearLayout        //线性布局
----TableLayout        //表格布局
----RelativeLayout    //绝对布局

 

对于CentOS7系统,如果需要重新分配磁盘空间,可以按照以下步骤进行操作: 1. 使用LVM(逻辑卷管理)的方式进行扩容。可以使用fdisk命令查看磁盘空间是否增加,但是需要注意,新增的空间还没有进行分区划分,没有被划分到根目录。可以使用以下命令添加新分区: fdisk /dev/sda 然后选择n来添加新分区。 2. 执行以下命令,使系统重新扫描磁盘空间: echo 1 > /sys/block/sda/device/rescan 然后使用fdisk -l命令查看空间是否已经增加。 3. 使用lvextend命令将home空间重新分配扩容给根目录。 例如,如果将50G的home空间分配40G给根目录,可以使用以下命令: lvextend -L 40G /dev/centos/root 通过以上步骤,可以重新分配CentOS 7的磁盘空间。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [linuxCentos7的LVM磁盘扩容问题](https://download.csdn.net/download/weixin_38631773/14891934)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [CentOS7 磁盘重新调整分配](https://blog.csdn.net/qq_29277155/article/details/126847199)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [Centos磁盘空间转移重新分配](https://blog.csdn.net/weixin_45380725/article/details/130828948)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

达帮主

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值