新聞中心
這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
創(chuàng)新互聯(lián)鴻蒙OS教程:鴻蒙OS LayoutManager
LayoutManager

java.lang.Object
|---ohos.agp.components.LayoutManager
public abstract class LayoutManager
extends Object所有布局管理器的抽象類。
構(gòu)造函數(shù)摘要
| 構(gòu)造函數(shù) | 描述 |
|---|---|
| LayoutManager() | 用于創(chuàng)建 LayoutManager 實(shí)例的默認(rèn)構(gòu)造函數(shù)。 |
方法總結(jié)
| 修飾符和類型 | 方法 | 描述 |
|---|---|---|
| int | getOrientation() | 獲取布局方向。 |
| void | setOrientation(int orientation) | 設(shè)置布局方向。 |
| 從類 java.lang.Object 繼承的方法 |
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
構(gòu)造函數(shù)詳細(xì)信息
LayoutManager
public LayoutManager()
用于創(chuàng)建 LayoutManager 實(shí)例的默認(rèn)構(gòu)造函數(shù)。
方法詳情
setOrientation
public void setOrientation(int orientation)
設(shè)置布局方向。
如果不設(shè)置布局方向,則默認(rèn)使用 Component.VERTICAL。
參數(shù):
| 參數(shù)名稱 | 參數(shù)描述 |
|---|---|
| orientation | 指示要設(shè)置的布局方向。 Component.HORIZONTAL 表示組件水平排列,Component.VERTICAL 表示組件垂直排列。 |
Throws:
| Throw名稱 | Throw描述 |
|---|---|
| IllegalArgumentException | 如果參數(shù)值與 Component.HORIZONTAL 或 Component.VERTICAL 不對(duì)應(yīng),則引發(fā)異常。 |
getOrientation
public int getOrientation()
獲取布局方向。
返回:
如果組件水平排列,則返回 Component.HORIZONTAL; 如果組件是垂直排列的,則返回 Component.VERTICAL。
網(wǎng)站標(biāo)題:創(chuàng)新互聯(lián)鴻蒙OS教程:鴻蒙OS LayoutManager
本文地址:http://www.5511xx.com/article/dhgghjd.html


咨詢
建站咨詢
