鴻蒙OS Ability Ability.LayoutParamsHelper

2020-10-26 13:57 更新

幫助您使用 Intent 設(shè)置應(yīng)用程序啟動窗口的布局參數(shù)。

構(gòu)造器摘要

建設(shè)者 描述
LayoutParamsHelper(Intent intentLayout)

方法總結(jié)

修飾符和類型 方法 描述
Ability.LayoutParamsHelper setAlpha(float alpha) 設(shè)置窗口的 Alpha。
Ability.LayoutParamsHelper setDimAmount(float dimAmount) 設(shè)置窗口后的暗淡量。
Ability.LayoutParamsHelper setFlags(int 標志,int 掩碼) 設(shè)置窗口的標志。
Ability.LayoutParamsHelper setGravity(int 引力) 設(shè)置窗口的重力。
Ability.LayoutParamsHelper setHeight](https://developer.harmonyos.com/en/docs/documentation/doc-references/ability_layoutparamshelper-0000001054119936#ZH-CN_TOPIC_0000001054119936__setHeight-int-)(int 高度 設(shè)置窗口的高度。
Ability.LayoutParamsHelper setWidth(int 寬度) 設(shè)置窗口的寬度。
Ability.LayoutParamsHelper setX(int x) 設(shè)置窗口的X坐標。
Ability.LayoutParamsHelper setY(int y) 設(shè)置窗口的Y坐標。
從類 java.lang 繼承的方法。object
cloneequals,finalizegetClass,hashCode,notify,notifyAll,toString,waitwait,wait

構(gòu)造器詳細信息

布局參數(shù)助手

public LayoutParamsHelper(Intent intentLayout)

方法細節(jié)

設(shè)置 X

public Ability.LayoutParamsHelper setX(int x)

設(shè)置窗口的 X 坐標。

參數(shù):

參數(shù)名稱 參數(shù)說明
X 指示在 WindowManager.LayoutConfig.x中設(shè)置的 X 坐標。

返回值:

返回具有指定X坐標的 LayoutParamsHelper 對象。

設(shè)定

public Ability.LayoutParamsHelper setY(int y)

設(shè)置窗口的Y坐標。

參數(shù):

參數(shù)名稱 參數(shù)說明
? 指示在 WindowManager.LayoutConfig.y中 設(shè)置的 Y 坐標。

返回值:

返回具有指定 Y 坐標的 LayoutParamsHelper 對象。

設(shè)置寬度

public Ability.LayoutParamsHelper setWidth(int width)

設(shè)置窗口的寬度。

參數(shù):

參數(shù)名稱 參數(shù)說明
寬度 指示在 WindowManager.LayoutConfig.width中 設(shè)置的寬度。

返回值:

返回具有指定寬度的 LayoutParamsHelper 對象。

設(shè)置高度

public Ability.LayoutParamsHelper setHeight(int height)

設(shè)置窗口的高度。

參數(shù):

參數(shù)名稱 參數(shù)說明
高度 指示在 WindowManager.LayoutConfig.height中](http://www.o2fo.com/harmonyos/harmonyos-5a1w3cys.html)設(shè)置的高度。

返回值:

返回具有指定高度的 LayoutParamsHelper 對象。

setAlpha

public Ability.LayoutParamsHelper setAlpha(float alpha)

設(shè)置窗口的 Alpha。

參數(shù):

參數(shù)名稱 參數(shù)說明
α 指示在 WindowManager.LayoutConfig中設(shè)置的 Alpha 。

返回值:

返回具有指定 Alpha 的 LayoutParamsHelper 對象。

設(shè)置暗淡金額

public Ability.LayoutParamsHelper setDimAmount(float dimAmount)

設(shè)置窗口后的暗淡量。

參數(shù):

參數(shù)名稱 參數(shù)說明
dimAmount 指示在 WindowManager.LayoutConfig.dim中 設(shè)置的暗淡數(shù)量。

返回值:

返回具有指定數(shù)量的 dim 的 LayoutParamsHelper 對象。

setFlags

public Ability.LayoutParamsHelper setFlags(int 標志,int mask)

設(shè)置窗口的標志。

參數(shù):

參數(shù)名稱 參數(shù)說明
標志 指示在 WindowManager.LayoutConfig.flags中 設(shè)置的標志。
面具 標志位掩碼

返回值:

返回帶有指定標志的 LayoutParamsHelper 對象。

設(shè)置重力

public Ability.LayoutParamsHelper setGravity(int 萬有引力)

設(shè)置窗口的重力。

參數(shù):

參數(shù)名稱 參數(shù)說明
重力 指示在  LayoutAlignment中設(shè)置的重力。

返回值:

返回具有指定重力的 LayoutParamsHelper 對象。

以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號