| android:layout_row=“数字” | 表示显示在第几行,如果通过 layout_column
与 layout_row
组合使用,将多个设置到通一个位置,则会叠加覆盖 |
| android:layout_columnSpan=“数字” | 占用一行几个列位置 |
| android:layout_rowSpan=“数字” | 占用一列的几个行位置 |
| android:layout_columnWeight=“数字” | 该控件的列权重,与 android:layout_weight
类似,例如有 GridLayout
上两列,都设置 android:layout_columnWeight = "1"
,则两列各占 GridLayout
宽度的一半 |
| android:layout_rowWeight=“数字” | 跟 layout_columnWeight
同理 |
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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”>
<GridLayout
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:columnCount=“4”
android:rowCount=“6”
tools:ignore=“MissingConstraints”>
<View
android:layout_width=“80dp”
android:layout_height=“80dp”
android:background=“#ffc”/>
<View
android:layout_width=“80dp”
android:layout_height=“80dp”
android:background=“#fcf”/>
<View
android:layout_width=“80dp”
android:layout_height=“80dp”
android:background=“#cff”/>
<View
android:layout_width=“80dp”
android:layout_height=“80dp”
android:background=“#ccc”/>
<View
android:layout_rowSpan=“2”
android:layout_width=“80dp”
android:layout_height=“160dp”
android:background=“#ddd”/>
<View
android:layout_rowSpan=“2”
android:layout_width=“80dp”
最后
写到这里也结束了,在文章最后放上一个小小的福利,以下为小编自己在学习过程中整理出的一个学习思路及方向,从事互联网开发,最主要的是要学好技术,而学习技术是一条慢长而艰苦的道路,不能靠一时激情,也不是熬几天几夜就能学好的,必须养成平时努力学习的习惯,更加需要准确的学习方向达到有效的学习效果。
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
618156601)**
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!