新聞中心
Component.EstimateSpec

創(chuàng)新互聯(lián)公司專注于陸河網(wǎng)站建設(shè)服務(wù)及定制,我們擁有豐富的企業(yè)做網(wǎng)站經(jīng)驗。 熱誠為您提供陸河營銷型網(wǎng)站建設(shè),陸河網(wǎng)站制作、陸河網(wǎng)頁設(shè)計、陸河網(wǎng)站官網(wǎng)定制、微信小程序定制開發(fā)服務(wù),打造陸河網(wǎng)絡(luò)公司原創(chuàng)品牌,更為您提供陸河網(wǎng)站排名全網(wǎng)營銷落地服務(wù)。
java.lang.Object
|---ohos.agp.components.Component.EstimateSpec
public static class Component.EstimateSpec
extends Object定義組件的度量規(guī)范。
EstimateSpec 封裝了子組件從父組件繼承的排列要求。 每個 EstimateSpec 指示對寬度或高度以及模式的要求。 EstimateSpec 有三種可能的模式:UNCONSTRAINT、PRECISE 和 NOT_EXCEED。
字段摘要
| 修飾符和類型 | 字段 | 描述 |
|---|---|---|
| static int | ESTIMATED_STATE_BIT_MASK | 估計大小的狀態(tài)位 |
| static int | NOT_EXCEED | 在此模式下,已為子組件指定了最大尺寸。 |
| static int | PRECISE | 在這種模式下,父組件已經(jīng)確定了子組件的確切大小。 |
| static int | UNCONSTRAINT | 在這種模式下,父組件對子組件沒有限制,這意味著子組件可以是任何它想要的大小。 |
構(gòu)造函數(shù)摘要
| 構(gòu)造函數(shù) | 描述 |
|---|---|
| EstimateSpec() |
方法總結(jié)
| 修飾符和類型 | 方法 | 描述 |
|---|---|---|
| static int | getChildSizeWithMode(int size, int estimatedConfig, int childEstimatedConfig) | 根據(jù)指定的大小和模式為子組件創(chuàng)建度量規(guī)范。 |
| static int | getMode(int estimateSpec) | 獲取該組件的顯示方式。 |
| static int | getSize(int estimateSpec) | 從提供的估計規(guī)范中提取大小。 |
| static int | getSizeWithMode(int size, int mode) | 根據(jù)指定的大小和模式創(chuàng)建度量規(guī)范。 |
| 從類 java.lang.Object 繼承的方法 |
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
字段詳細信息
ESTIMATED_STATE_BIT_MASK
public static final int ESTIMATED_STATE_BIT_MASK
估計大小的狀態(tài)位
NOT_EXCEED
public static final int NOT_EXCEED
在此模式下,已為子組件指定了最大尺寸。 子組件不能超過指定的大小。
PRECISE
public static final int PRECISE
在這種模式下,父組件已經(jīng)確定了子組件的確切大小。
UNCONSTRAINT
public static final int UNCONSTRAINT
在這種模式下,父組件對子組件沒有限制,這意味著子組件可以是任何它想要的大小。
構(gòu)造函數(shù)詳細信息
EstimateSpec
public EstimateSpec()
方法詳情
getSizeWithMode
public static int getSizeWithMode(int size, int mode)
根據(jù)指定的大小和模式創(chuàng)建度量規(guī)范。
參數(shù):
| 參數(shù)名稱 | 參數(shù)描述 |
|---|---|
| size | 指示度量規(guī)范中包含的寬度或高度。 |
| mode | 指示度量規(guī)范中包含的模式。 該值必須是 UNCONSTRAINT、PRECISE 或 NOT_EXCEED。 |
返回:
以模式返回大小。
getMode
public static int getMode(int estimateSpec)
獲取該組件的顯示方式。
參數(shù):
| 參數(shù)名稱 | 參數(shù)描述 |
|---|---|
| estimateSpec | 表示估計規(guī)格。 |
返回:
返回此組件的顯示模式。
getSize
public static int getSize(int estimateSpec)
從提供的估計規(guī)范中提取大小。
參數(shù):
| 參數(shù)名稱 | 參數(shù)描述 |
|---|---|
| estimateSpec | 表示度量規(guī)范。 |
返回:
返回度量規(guī)范的大小。
getChildSizeWithMode
public static int getChildSizeWithMode(int size, int estimatedConfig, int childEstimatedConfig)
根據(jù)指定的大小和模式為子組件創(chuàng)建度量規(guī)范。
參數(shù):
| 參數(shù)名稱 | 參數(shù)描述 |
|---|---|
| size | 指示子組件想要多大。 |
| estimatedConfig | 指示父級的模式。 |
| childEstimatedConfig | 指示子組件的模式。 |
返回:
返回具有子組件模式的大小。
新聞名稱:創(chuàng)新互聯(lián)鴻蒙OS教程:鴻蒙OSComponent.EstimateSpec
URL網(wǎng)址:http://fisionsoft.com.cn/article/coospch.html


咨詢
建站咨詢
