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

public interface AttrSet定義如何存儲、讀取和使用與 Component 控件相關(guān)的屬性,以及其他需要使用屬性集的類。
字段摘要
| 修飾符和類型 | 字段 | 描述 |
|---|---|---|
| static String | STYLE_ATTR | 定義屬性集中屬性的樣式。 |
方法總結(jié)
| 修飾符和類型 | 方法 | 描述 |
|---|---|---|
| OptionalAttr | getAttr(int index) | 使用其索引獲取屬性。 |
| OptionalAttr | getAttr(String fullName) | 通過名稱獲取屬性。 |
| int | getLength() | 獲取屬性集中的屬性數(shù)量。 |
| OptionalString | getStyle() | 獲取屬性樣式。 |
字段詳細(xì)信息
STYLE_ATTR
static final String STYLE_ATTR
定義屬性集中屬性的樣式。
方法詳情
getStyle
OptionalString getStyle()
獲取屬性樣式。
返回:
返回屬性樣式。
getLength
int getLength()
獲取屬性集中的屬性數(shù)量。
返回:
返回屬性的數(shù)量。
getAttr
OptionalAttr getAttr(int index)
使用其索引獲取屬性。
參數(shù):
| 參數(shù)名稱 | 參數(shù)描述 |
|---|---|
| index | 表示索引值,范圍從 0 到現(xiàn)有屬性的數(shù)量減 1。超出此范圍的值不會產(chǎn)生錯(cuò)誤,但會收到一個(gè)空的 Optional 對象。 |
返回:
返回索引對應(yīng)的屬性。
getAttr
OptionalAttr getAttr(String fullName)
通過名稱獲取屬性。
將返回與 fullName 匹配的屬性。
參數(shù):
| 參數(shù)名稱 | 參數(shù)描述 |
|---|---|
| fullName | 指示屬性的完全限定名稱。 |
返回:
返回匹配的屬性。
網(wǎng)頁名稱:創(chuàng)新互聯(lián)鴻蒙OS教程:鴻蒙OSAttrSet
鏈接分享:http://www.dlmjj.cn/article/djhjgod.html


咨詢
建站咨詢
