鴻蒙OS Ability Ability.WindowAttributeHelper

2020-10-26 14:03 更新

幫助您使用 Intent 設(shè)置當(dāng)前應(yīng)用程序的窗口屬性。

此類將窗口的填充設(shè)置封裝在 Intent 中,并且您無需關(guān)心數(shù)據(jù)的存儲(chǔ)方式。

構(gòu)造器摘要

建設(shè)者 描述
WindowAttributeHelper(Intent intentAttribute) 用于創(chuàng)建 WindowAttributeHelper 實(shí)例的參數(shù)化構(gòu)造函數(shù)。

方法總結(jié)

修飾符和類型 方法 描述
Ability.WindowAttributeHelpe setBottomPadding(int 底部) 設(shè)置窗口的底部填充。
Ability.WindowAttributeHelper setLeftPadding(向左整數(shù)) 設(shè)置窗口的左填充。
Ability.WindowAttributeHelper setRightPadding(int 右) 設(shè)置窗口的右填充。
Ability.WindowAttributeHelper setTopPadding(int 頂部) 設(shè)置窗口的頂部填充。
從類 java.lang 繼承的方法。object
clone,equals,finalize,getClass,hashCodenotify,notifyAlltoString,wait,waitwait

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

窗口屬性助手

public WindowAttributeHelper(Intent intentAttribute)

用于創(chuàng)建 WindowAttributeHelper 實(shí)例的參數(shù)化構(gòu)造函數(shù)。

調(diào)用 WindowAttributeHelper 提供的設(shè)置方法后,實(shí)例中攜帶的 Intent 將自動(dòng)存儲(chǔ)屬性設(shè)置。

參數(shù):

參數(shù)名稱 參數(shù)說明
intentAttribute 指示用于存儲(chǔ)窗口屬性的 Intent。

方法細(xì)節(jié)

設(shè)置左填充

public Ability.WindowAttributeHelper setLeftPadding(int left)

設(shè)置窗口的左填充。

參數(shù):

參數(shù)名稱 參數(shù)說明
剩下 指示要設(shè)置的窗口的左填充(以像素為單位)

返回值:

返回具有指定左填充的 WindowAttributeHelper 對(duì)象。

設(shè)置上填充

public Ability.WindowAttributeHelper setTopPadding(int top)

設(shè)置窗口的頂部填充。

參數(shù):

參數(shù)名稱 參數(shù)說明
最佳 指示要設(shè)置的窗口的頂部填充,以像素為單位

返回值:

返回具有指定頂部填充的 WindowAttributeHelper 對(duì)象。

設(shè)置右填充

public Ability.WindowAttributeHelper setRightPadding(int right)

設(shè)置窗口的右填充。

參數(shù):

參數(shù)名稱 參數(shù)說明
對(duì) 指示要設(shè)置的窗口的右填充,以像素為單位

返回值:

返回具有指定右填充的 WindowAttributeHelper 對(duì)象。

設(shè)置底部填充

public Ability.WindowAttributeHelper setBottomPadding(int bottom)

設(shè)置窗口的底部填充。

參數(shù):

參數(shù)名稱 參數(shù)說明
底部 指示要設(shè)置的窗口的底部填充,以像素為單位。

返回值:

返回具有指定底部填充的 WindowAttributeHelper 對(duì)象。

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

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)