GridLayout grid layout of Android layout

The grid layout label is GridLayout. This layout is new to Android 4.0. This layout can only be used after version 4.0.

However, some new things have been added

① Like linear layout, it can set the alignment of components in the container

② Components in the container can span multiple rows or columns (compared with tablelayout, components are placed directly in one row)

Because it is new in Android 4.0, API level 14, the SDK before this version

All projects need to be imported, which will be described in detail later

Common attributes:

Arrange alignment:

① Set the arrangement of components: Android: orientation = "" vertical (vertical, default) or horizontal (horizontal)

② Set the alignment of components: Android: Layout_ Gravity = "" center, left, right, but, if you want to use two at the same time: eg: but | left

Learning map

(1) Introduction

Grid layout is represented by GridLayout, which is a new layout manager added after Android 4.0. Therefore, it needs to be used in the version after Android 4.0. If the layout manager is used on an earlier platform, it needs to import the corresponding support library < Android. Support. V7. Widget. GridLayout >

(2) Case list - calculator

The above content is the GridLayout grid layout related knowledge of Android layout introduced by Xiaobian. I hope you like it.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>