新聞中心
Component

java.lang.Object
|---ohos.agp.components.Component
public class Component
extends Object
為用戶界面 (UI) 提供基本組件。
每個組件在屏幕上占據(jù)一個矩形區(qū)域,負(fù)責(zé)在這個區(qū)域內(nèi)進(jìn)行繪制和事件處理。 Component 是控件的基類,用于創(chuàng)建交互式 UI 組件。 它的子類 ComponentContainer 是所有布局的基類,它定義了其他組件或組件組的布局屬性。
嵌套類摘要
| 修飾符和類型 | 類 | 描述 |
|---|---|---|
| static interface | Component.BindStateChangedListener | 提供當(dāng)組件綁定到其窗口或從其窗口分離時要調(diào)用的回調(diào)。 |
| static interface | Component.CanAcceptScrollListener | 提供要調(diào)用的偵聽器來決定是否可以接受滾動手勢。 |
| static interface | Component.ClickedListener | 提供單擊組件時要調(diào)用的回調(diào)。 |
| static interface | Component.ComponentStateChangedListener | 為組件的狀態(tài)更改事件提供回調(diào)。 |
| static interface | Component.ContourRefreshedListener | 為用于為組件設(shè)置自定義 Contour 對象的回調(diào)提供偵聽器。 |
| static class | Component.DefSpeechEventListener | 提供在語音事件綁定到組件時調(diào)用的默認(rèn)回調(diào)。 |
| static interface | Component.DoubleClickedListener | 提供雙擊組件時要調(diào)用的回調(diào)。 |
| static class | Component.DragFeedbackProvider | 提供系統(tǒng)在拖放操作期間顯示的圖像(稱為“拖動陰影”)。 |
| static interface | Component.DraggedListener | 提供當(dāng)手勢識別器將拖動事件分派到組件時要調(diào)用的回調(diào)。 |
| static interface | Component.DrawTask | 實現(xiàn)繪圖任務(wù)。 |
| static interface | Component.EditEventListener | 提供偵聽器來處理由鍵盤快捷鍵觸發(fā)的編輯事件,當(dāng)它們分發(fā)到組件時。 |
| static interface | Component.EstimateSizeListener | 提供用于自定義尺寸(寬度/高度)估計過程的界面。 |
| static class | Component.EstimateSpec | 定義組件的度量規(guī)范。 |
| static class | Component.FadeEffectEnum | 枚舉可以應(yīng)用淡出效果的組件指示器的類型。 |
| static interface | Component.FocusChangedListener | 提供當(dāng)組件的焦點狀態(tài)更改時要調(diào)用的回調(diào)。 |
| static interface | Component.ForwardHoverListener | 提供在鼠標(biāo)懸停事件轉(zhuǎn)發(fā)到子組件之前調(diào)用的回調(diào)。 |
| static interface | Component.ForwardTouchListener | 在將觸摸事件轉(zhuǎn)發(fā)到子組件之前提供要調(diào)用的回調(diào)。 |
| static class | Component.GestureType | 枚舉手勢類型。 |
| static interface | Component.HoverEventListener | 提供從組件調(diào)度懸停事件時要調(diào)用的回調(diào)。 |
| static interface | Component.KeyEventListener | 提供從組件調(diào)度鍵事件時要調(diào)用的回調(diào)。 |
| static class | Component.LayoutDirection | 枚舉水平布局方向。 |
| static interface | Component.LayoutRefreshedListener | 提供在再次布局組件時調(diào)用的回調(diào)。 |
| static interface | Component.LongClickedListener | 提供從組件分派長觸摸事件時要調(diào)用的回調(diào)。 |
| static class | Component.MeasureSpec | 已棄用。 此更改自 API 版本 6 起生效。已替換為 EstimateSpec |
| static interface | Component.MouseEventListener | 提供從組件分派鼠標(biāo)事件時要調(diào)用的回調(diào)。 |
| static interface | Component.MousePointerStyleListener | 提供一個監(jiān)聽器來觀察鼠標(biāo)指針樣式的變化。 |
| static interface | Component.OnDragListener | 將拖動事件分派到組件時調(diào)用的回調(diào)。 |
| static interface | Component.RotationEventListener | 提供從組件分派旋轉(zhuǎn)事件時要調(diào)用的回調(diào)。 |
| static interface | Component.ScaledListener | 為組件的縮放事件提供回調(diào)。 |
| static interface | Component.ScrolledListener | 提供從組件分派滾動事件時要調(diào)用的回調(diào)。 |
| static class | Component.ShadowDevice | 表示窗口的陰影設(shè)備。 |
| static class | Component.ShadowMode | 指示窗口的陰影模式。 |
| static class | Component.ShadowSize | 指示窗口的陰影大小。 |
| static interface | Component.SpeechEventListener | 提供當(dāng)語音事件綁定到組件時要調(diào)用的回調(diào)。 |
| static interface | Component.TouchEventListener | 提供在將觸摸事件分派到組件時要調(diào)用的回調(diào)。 |
| static interface | Component.UnconsumedKeyEventListener | 如果鍵盤事件沒有被使用,則提供一個偵聽器來調(diào)度鍵盤事件。 |
| static class | Component.VoiceEvent | 為組件提供語音事件。 |
字段摘要
| 修飾符和類型 | 字段 | 描述 |
|---|---|---|
| static int | ACCESSIBILITY_ADAPTABLE | 表示可以訪問該組件。 |
| static int | ACCESSIBILITY_DISABLE | 表示無法訪問該組件。 |
| static int | ACCESSIBILITY_ENABLE | 表示該組件已啟用。 |
| static int | AXIS_X | 表示 x 軸。 |
| static int | AXIS_Y | 表示 y 軸。 |
| static Component.ContourRefreshedListener | CONTOUR_BACKGROUND | 組件的默認(rèn) ContourRefreshedListener。 |
| static Component.ContourRefreshedListener | CONTOUR_BORDER | 提供與組件矩形邊框匹配的輪廓。 |
| static Component.ContourRefreshedListener | CONTOUR_PADDING_BORDER | 提供與組件的矩形填充邊框匹配的輪廓。 |
| static float | DEFAULT_SCALE | 表示縮放組件的默認(rèn)縮放系數(shù)。 |
| static int | DRAG_DOWN | 表示向下拖動滾動條。 |
| static int | DRAG_HORIZONTAL | 表示水平拖動滾動條。 |
| static int | DRAG_HORIZONTAL_VERTICAL | 表示滾動條水平和垂直拖動。 |
| static int | DRAG_LEFT | 表示向左拖動滾動條。 |
| static int | DRAG_RIGHT | 表示向右拖動滾動條。 |
| static int | DRAG_UP | 表示向上拖動滾動條。 |
| static int | DRAG_VERTICAL | 表示垂直拖動滾動條。 |
| static int | EVENT_TYPE_COMPONENT_ACCESSIBILITY_FOCUSED | 表示一個事件,指示獲得了可訪問性焦點。 |
| static int | EVENT_TYPE_COMPONENT_ACCESSIBILITY_FOCUSED_CLEAR | 表示一個事件,指示清除輔助功能焦點。 |
| static int | EVENT_TYPE_COMPONENT_CLICKED | 表示一個指示組件被單擊的事件。 |
| static int | EVENT_TYPE_COMPONENT_FOCUSED | 表示一個指示組件獲得焦點的事件。 |
| static int | EVENT_TYPE_COMPONENT_LONG_CLICKED | 表示一個指示組件被長按的事件。 |
| static int | EVENT_TYPE_COMPONENT_SCROLLED | 表示一個指示組件滾動的事件。 |
| static int | EVENT_TYPE_COMPONENT_SELECTED | 表示一個指示組件被選中的事件。 |
| static int | EVENT_TYPE_COMPONENT_TEXT_UPDATE | 表示指示 Text 組件中的文本已更改的事件。 |
| static int | EVENT_TYPE_NOTICE | 表示指示應(yīng)用程序發(fā)送通知的事件。 |
| static int | EVENT_TYPE_NOTIFICATION_STATE_UPDATE | 表示指示顯示通知的事件。 |
| static int | EVENT_TYPE_TOAST_SHOW | 表示指示顯示 toast 的事件。 |
| static int | EVENT_TYPE_WINDOW_STATE_UPDATE | 表示指示窗口狀態(tài)已更新的事件。 |
| static int | FOCUS_ADAPTABLE | 組件自行決定可聚焦性。 |
| static int | FOCUS_DISABLE | 該組件不需要擊鍵。 |
| static int | FOCUS_ENABLE | 該組件需要擊鍵。 |
| static int | FOCUS_NEXT | 將焦點移至下一個可點擊項目。 |
| static int | FOCUS_PREVIOUS | 將焦點移到上一個可點擊項目。 |
| static int | FOCUS_SIDE_BOTTOM | 向下移動焦點。 |
| static int | FOCUS_SIDE_LEFT | 將焦點移到左側(cè)。 |
| static int | FOCUS_SIDE_RIGHT | 將焦點向右移動。 |
| static int | FOCUS_SIDE_TOP | 上移焦點。 |
| static int | HIDE | 該組件是不可見的,并且不占用任何用于布局目的的空間。 |
| static int | HORIZONTAL | 表示水平方向模式。 |
| static int | ID_DEFAULT | 組件的默認(rèn) ID。 |
| static int | INHERITED_MODE | 表示組件使用其父組件的顯示模式。 |
| static int | INVISIBLE | 該組件是不可見的,但仍為布局目的占用空間。 |
| protected Element | mBackgroundElement | 表示在組件背景中繪制的元素對象。 |
| protected Canvas | mCanvasForTaskOverContent | 用于內(nèi)容和前景之間的自定義繪圖任務(wù)的畫布。 |
| protected Canvas | mCanvasForTaskUnderContent | 用于背景和內(nèi)容之間的自定義繪圖任務(wù)的畫布。 |
| protected ComponentParent | mComponentParent | 指示組件的父布局。 |
| protected Context | mContext | 表示上下文。 |
| protected Component.DrawTask | mDrawTaskOverContent | 自定義內(nèi)容和前景之間的繪圖任務(wù)。 |
| protected Component.DrawTask | mDrawTaskUnderContent | 自定義內(nèi)容和背景之間的繪圖任務(wù)。 |
| protected Component.EstimateSizeListener | mEstimateSizeListener | 在組件估計尺寸過程中自定義組件的寬度和高度 |
| protected Element | mForegroundElement | 表示在組件前景中繪制的元素對象。 |
| protected Component.ForwardHoverListener | mForwardHoverListener | 表示轉(zhuǎn)發(fā)鼠標(biāo)懸停事件時調(diào)用的回調(diào)。 |
| protected Component.HoverEventListener | mHoverEventListener | 表示接收到鼠標(biāo)懸停事件時調(diào)用的回調(diào)。 |
| protected Component.KeyEventListener | mKeyEventListener | 表示當(dāng)焦點組件接收到鍵事件時調(diào)用的回調(diào)。 |
| protected Component.MouseEventListener | mMouseEventListener | 表示接收到鼠標(biāo)事件時調(diào)用的回調(diào)。 |
| protected float[] | mPosition | 為位置創(chuàng)建浮點值。 |
| protected Component.RotationEventListener | mRotationEventListener | 表示接收旋轉(zhuǎn)事件時調(diào)用的回調(diào)。 |
| protected ShadowElement | mShadowElement | 表示以組件的 shadowstyle 繪制的元素對象。 |
| protected Component.UnconsumedKeyEventListener | mUnconsumedKeyEventListener | 表示接收到未使用的按鍵事件時調(diào)用的回調(diào)。 |
| static int | OVAL_MODE | 表示組件內(nèi)容以橢圓顯示。 |
| static int | OVAL_SCROLL_BAR_MODE | 表示滾動條顯示為橢圓。 |
| protected static int | POSITION_X_INDEX | 位置數(shù)組中的 X 軸坐標(biāo)。 |
| protected static int | POSITION_Y_INDEX | 位置數(shù)組中的 Y 軸坐標(biāo)。 |
| static int | RECT_MODE | 表示組件內(nèi)容以矩形顯示。 |
| static int | RECT_SCROLL_BAR_MODE | 指示滾動條顯示為矩形。 |
| static int | SCROLL_AUTO_STAGE | 表示組件會慣性滾動以響應(yīng)專用操作(例如,甩動或反彈)。 |
| static int | SCROLL_IDLE_STAGE | 表示滾動已經(jīng)結(jié)束,組件處于空閑狀態(tài)。 |
| static int | SCROLL_NORMAL_STAGE | 表示組件響應(yīng)外部操作(例如,用戶觸摸輸入)自然滾動。 |
| static int | UNSPECIFIED_SCROLL_BAR_MODE | 指示滾動條的模式遵循顯示組件的模式。 |
| static int | VERTICAL | 指示垂直方向模式。 |
| static int | VISIBLE | 該組件是可見的。 |
構(gòu)造函數(shù)摘要
| 構(gòu)造函數(shù) | 描述 |
|---|---|
| Component(Context context) | 默認(rèn)構(gòu)造函數(shù)用于使用默認(rèn)屬性集和樣式創(chuàng)建 Component 實例。 |
| Component(Context context, AttrSet attrSet) | 一個構(gòu)造函數(shù),用于在解析 XML 文件后使用指定的屬性集和默認(rèn)樣式創(chuàng)建一個 Component 實例。 |
| Component(Context context, AttrSet attrSet, int resId) | 用于在 XML 文件解析后根據(jù)上下文、屬性集和默認(rèn)主題創(chuàng)建 Component 實例的構(gòu)造函數(shù)。 |
| Component(Context context, AttrSet attrSet, String styleName) | 一個構(gòu)造函數(shù),用于在解析 XML 文件后,使用指定的屬性集和指定的樣式創(chuàng)建一個 Component 實例。 |
方法總結(jié)
| 修飾符和類型 | 方法 | 描述 |
|---|---|---|
| void | addDrawTask(Component.DrawTask task) | 在前景和組件內(nèi)容之間添加繪圖任務(wù)。 |
| void | addDrawTask(Component.DrawTask task, int layer) | 添加繪圖任務(wù)。 |
| void | addScrolledListener(Component.ScrolledListener listener) | 添加一個監(jiān)聽器來監(jiān)聽組件的滾動階段或位置發(fā)生變化時報告的滾動事件。 |
| void | announceAccessibility(String text) | 為 TYPE_ANNOUNCEMENT 類型的可訪問性事件設(shè)置文本。 |
| void | arrange(int left, int top, int width, int height) | 相對于父布局定位組件。 |
| CornerMark | bindCornerMark() | 將角標(biāo)記對象設(shè)置為顯示在組件頂部。 |
| boolean | callOnClick() | 調(diào)用分配的 OnClickListener。 |
| boolean | canScroll(int orientation) | 檢查組件是否可以按指定方向滾動。 |
| void | clearFocus() | 請求放棄焦點。 |
| AnimatorProperty | createAnimatorProperty() | 創(chuàng)建與組件關(guān)聯(lián)的屬性動畫器對象。 |
| void | disableFadeEffect(Component.FadeEffectEnum fadeEffectEnum) | 當(dāng)組件未滾動時,禁用滾動條或邊界指示器的淡出效果。 |
| protected void | dispatchRestoreState(PlainArraySequenceable stateContainer) | 分發(fā)狀態(tài)恢復(fù)過程來恢復(fù)該組件及其子組件的狀態(tài)。 |
| protected void | dispatchSaveState(PlainArraySequenceable stateContainer) | 分發(fā)狀態(tài)保存過程,保存該組件及其子組件的狀態(tài)。 |
| void | draw(Canvas canvas) | 在畫布上繪制此組件及其子組件。 |
| void | enableCornerMark(boolean enable) | 啟用或禁用當(dāng)前組件的角標(biāo)記。 |
| void | enableFadeEffect(Component.FadeEffectEnum fadeEffectEnum) | 當(dāng)組件未滾動時,啟用滾動條或邊界指示器的淡出效果。 |
| void | enableSaveState(boolean isEnabled) | 設(shè)置此組件及其子組件是否可以保存其狀態(tài)。 |
| void | enableScrollBar(int direction, boolean enabled) | 設(shè)置是否為此組件啟用滾動條。 |
| void | estimateSize(int widthEstimatedConfig, int heightEstimatedConfig) | 設(shè)置組件的寬度和高度尺寸和要求 |
| boolean | executeDoubleClick() | 執(zhí)行此組件中發(fā)生的雙擊事件。 |
| boolean | executeLongClick() | 在組件中執(zhí)行長按事件。 |
| findComponentById(int id) | 查找具有給定 ID 的組件。 | |
| ComponentHolder | findComponentHolderById(int resId) | 使用資源 ID 獲取 ComponentHolder 實例。 |
| Component | findFocus() | 獲取當(dāng)前在其后代組件和自身中具有焦點的組件。 |
| Component | findNextFocusableComponent(int direction) | 查找下一個要關(guān)注的組件。 |
| boolean | findRequestNextFocus(int side) | 找到下一個獲得焦點的組件并為其請求焦點。 |
| int | getAccessibility() | 獲取可訪問性狀態(tài)。 |
| String | getAccessibilityDescription() | 獲取該組件的可訪問性描述。 |
| float | getAlpha() | 獲取組件的 alpha 值。 |
| float | getAltitude() | 獲取該組件在垂直于屏幕方向的基本深度位置。 |
| Element | getBackgroundElement() | 獲取組件背景中的元素。 |
| int | getBaseLine() | 獲取從文本基線到組件頂部的高度。 |
| int | getBottom() | 獲取組件相對于父布局的底部邊緣位置。 |
| float | getBoundaryFadeEffectBottomRate() | 獲得率乘以基本邊界寬度,得到組件淡化效果區(qū)域的底部邊界寬度。 |
| float | getBoundaryFadeEffectLeftRate() | 獲取速率乘以基本邊界寬度,得到組件淡化效果區(qū)域的左邊界寬度。 |
| float | getBoundaryFadeEffectRightRate() | 獲取速率乘以基本邊界寬度,得到組件淡化效果區(qū)域的右邊界寬度。 |
| float | getBoundaryFadeEffectTopRate() | 獲取速率乘以基本邊界寬度,得到組件淡化效果區(qū)域的頂部邊界寬度。 |
| float[] | getCenterZoomFactor() | 獲取縮放中心組件項的縮放系數(shù)。 |
| boolean | getCentralScrollMode() | 獲取中央滾動模式的狀態(tài)。 |
| Component.ClickedListener | getClickedListener() | 獲取監(jiān)聽該組件點擊事件的監(jiān)聽器。 |
| boolean | getClipEnabled() | 檢查此組件超出其父布局時是否啟用自動剪裁。 |
| CharSequence | getComponentDescription() | 獲取組件中內(nèi)容的描述。 |
| DimensFloat | getComponentMinSize() | 獲取此組件的可能最小大小。 |
| ComponentParent | getComponentParent() | 獲取組件的父布局。 |
| Rect | getComponentPosition() | 獲取組件相對于父布局的位置。 |
| DimensFloat | getComponentSize() | 獲取組件大小。 |
| Component.ComponentStateChangedListener | getComponentStateChangedListener() | 獲取監(jiān)聽該組件狀態(tài)變化的監(jiān)聽器。 |
| ComponentTreeObserver | getComponentTreeObserver() | 獲取組件的 ComponentTreeObserver。 |
| boolean | getContentEnable() | 獲取組件的內(nèi)容是否會被繪制。 |
| float[] | getContentPosition() | 繪制時獲取位置。 |
| float | getContentPositionX() | 獲取 X 軸坐標(biāo)。 |
| float | getContentPositionY() | 獲取 Y 軸坐標(biāo)。 |
| Context | getContext() | 獲取該組件持有的上下文對象。 |
| Contour | getContour() | 獲取當(dāng)前組件的 Contour 對象。 |
| Component.ContourRefreshedListener | getContourRefreshedListener() | 獲取對組件的 Contour 對象進(jìn)行更新的偵聽器。 |
| CornerMark | getCornerMark() | 獲取組件的角標(biāo)對象。 |
| float | getDragAcceptAngle() | 獲取為水平或垂直拖動識別器設(shè)置的偏轉(zhuǎn)角。 |
| Component.DraggedListener | getDraggedListener() | 獲取監(jiān)聽該組件拖動事件的監(jiān)聽器。 |
| Component.EditEventListener | getEditEventListener() | 獲取監(jiān)聽由鍵盤快捷鍵觸發(fā)并分發(fā)給該組件的編輯事件的監(jiān)聽器。 |
| int | getEstimatedHeight() | 返回組件的估計高度。 |
| int | getEstimatedWidth() | 返回組件的估計寬度。 |
| int | getFadeEffectBoundaryWidth() | 獲取組件淡化效果區(qū)域的邊界寬度。 |
| Color | getFadeEffectColor() | 獲取產(chǎn)生淡入淡出效果時顯示的顏色。 |
| int | getFocusable() | 獲取組件的可聚焦設(shè)置。 |
| boolean | getFocusBorderEnable() | 檢查當(dāng)該組件處于焦點時是否顯示焦點邊框。 |
| int | getFocusBorderPadding() | 獲取焦點邊框和此組件之間的填充。 |
| float[] | getFocusBorderRadius() | 獲取焦點邊界的四個角的半徑。 |
| int | getFocusBorderWidth() | 獲取焦點邊框的寬度。 |
| Element | getForegroundElement() | 獲取組件前景中的元素。 |
| int | getForegroundGravity() | 已棄用。 此更改從 API 版本 6 開始生效。此方法是多余的,因此已棄用。 |
| Component.ForwardHoverListener | getForwardHoverListener() | 獲取該組件向前鼠標(biāo)懸停事件的監(jiān)聽器。 |
| Component.ForwardTouchListener | getForwardTouchListener() | 獲取該組件前向觸摸事件的監(jiān)聽器。 |
| int | getGesturePriority(Component.GestureType gestureType) | 獲取手勢的優(yōu)先級。 |
| int | getHeight() | 獲取組件的高度。 |
| int[] | getHorizontalPadding() | 獲取此組件的水平填充。 |
| int[] | getHorizontalPosition() | 獲取組件相對于父布局的水平位置。 |
| Component.HoverEventListener | getHoverEventListener() | 獲取監(jiān)聽該組件懸停事件的監(jiān)聽器。 |
| int | getId() | 獲取組件的唯一標(biāo)識。 |
| Component.KeyEventListener | getKeyEventListener() | 獲取監(jiān)聽該組件關(guān)鍵事件的監(jiān)聽器。 |
| ComponentContainer.LayoutConfig | getLayoutConfig() | 獲取與組件關(guān)聯(lián)的布局參數(shù)。 |
| Component.LayoutDirection | getLayoutDirection() | 獲取該組件的布局方向。 |
| Component.LayoutDirection | getLayoutDirectionResolved() | 獲取該組件的解析布局方向。 |
| Component.LayoutRefreshedListener | getLayoutRefreshedListener() | 獲取監(jiān)聽該組件布局刷新的監(jiān)聽器。 |
| int | getLeft() | 獲取組件相對于父布局的左邊緣位置。 |
| int[] | getLocationOnScreen() | 獲取組件在屏幕上的絕對位置。 |
| int | getMarginBottom() | 獲取該組件的下邊距。 |
| int | getMarginLeft() | 獲取該組件的左邊距。 |
| int | getMarginRight() | 獲取該組件的右邊距。 |
| int[] | getMargins() | 獲取此組件的左、上、右和下邊距。 |
| int[] | getMarginsLeftAndRight() | 獲取該組件的水平邊距。 |
| int[] | getMarginsTopAndBottom() | 獲取該組件的垂直邊距。 |
| int | getMarginTop() | 獲取該組件的上邊距。 |
| Matrix | getMatrix() | 獲取當(dāng)前組件的轉(zhuǎn)換矩陣。 |
| int | getMinHeight() | 獲取組件的最小可能高度。 |
| int | getMinWidth() | 獲取組件的最小可能寬度。 |
| int | getMode() | 獲取該組件的顯示方式。 |
| int | getModeResolved() | 獲取持有該組件的設(shè)備的顯示模式。 |
| Component.MouseEventListener | getMouseEventListener() | 獲取監(jiān)聽該組件鼠標(biāo)事件的監(jiān)聽器。 |
| Component.MousePointerStyleListener | getMousePointerStyleListener() | 獲取鼠標(biāo)指針樣式更改的偵聽器。 |
| String | getName() | 獲取組件的名稱。 |
| int[] | getPadding() | 獲取該組件的內(nèi)邊距。 |
| int | getPaddingBottom() | 獲取組件的底部填充。 |
| int | getPaddingEnd() | 根據(jù)解析的布局方向獲取組件的結(jié)束填充。 |
| int | getPaddingLeft() | 獲取組件的左內(nèi)邊距。 |
| int | getPaddingRight() | 獲取組件的正確填充。 |
| int | getPaddingStart() | 根據(jù)解析的布局方向獲取組件的開始填充。 |
| int | getPaddingTop() | 獲取組件的頂部填充。 |
| Point | getPivot() | 獲取相對于父布局的樞軸。 |
| float | getPivotX() | 獲取組件旋轉(zhuǎn)縮放所圍繞的點,即軸心點的X軸坐標(biāo)。 |
| float | getPivotY() | 獲取樞軸點相對于父布局的 Y 軸坐標(biāo)。 |
| ResourceManager | getResourceManager() | 獲取與上下文關(guān)聯(lián)的資源管理器。 |
| int | getRight() | 獲取組件相對于父布局的右邊緣位置。 |
| float | getRotation() | 獲取組件相對于父布局繞 Z 軸旋轉(zhuǎn)的度數(shù)。 |
| Component.RotationEventListener | getRotationEventListener() | 獲取監(jiān)聽該組件旋轉(zhuǎn)事件的監(jiān)聽器。 |
| float | getRotationSensitivity() | 獲取組件的旋轉(zhuǎn)靈敏度。 |
| DimensFloat | getScale() | 獲取組件相對于父布局的樞軸周圍的比例因子。 |
| Component.ScaledListener | getScaledListener() | 獲取監(jiān)聽該組件縮放事件的監(jiān)聽器。 |
| float | getScaleX() | 獲取組件在 X 方向上相對于父布局的樞軸點的縮放因子。 |
| float | getScaleY() | 獲取組件在 Y 方向上相對于父布局的樞軸點的縮放因子。 |
| Color | getScrollbarBackgroundColor() | 獲取滾動條的背景顏色。 |
| Color | getScrollbarColor() | 獲取滾動條的顏色。 |
| int | getScrollbarFadingDelay() | 獲取滾動條消失之前的延遲。 |
| int | getScrollbarFadingDuration() | 獲取滾動條的淡出持續(xù)時間。 |
| int | getScrollBarMode() | 獲取正在顯示的滾動條的模式。 |
| float | getScrollbarRadius() | 獲取滾動條圓角邊框的半徑。 |
| boolean | getScrollbarRoundRect() | 獲取滾動條的圓角邊框。 |
| float | getScrollbarStartAngle() | 獲取圓形滾動條的起始角度。 |
| float | getScrollbarSweepAngle() | 獲取圓形滾動條的掃角。 |
| int | getScrollbarThickness() | 獲取滾動條的粗細(xì)。 |
| int | getScrollState() | 獲取組件滾動狀態(tài)。 |
| int | getScrollValue(int direction) | 獲取該組件的滾動偏移量。 |
| boolean | getSelfVisibleRect(Rect rect) | 允許獲取本地可見的 Rect(與組件的父級相關(guān)) |
| Color | getShadowColor() | 獲取組件的陰影顏色。 |
| Component.SpeechEventListener | getSpeechEventListener() | 獲取 setSpeechEventListener(ohos.agp.components.Component.SpeechEventListener) 設(shè)置的監(jiān)聽器。 |
| Object | getTag() | 獲取組件的標(biāo)簽。 |
| int | getTop() | 獲取組件相對于父布局的上邊緣位置。 |
| Component.TouchEventListener | getTouchEventListener() | 獲取監(jiān)聽該組件觸摸事件的監(jiān)聽器。 |
| String | getTransitionSymbol() | 獲取過渡符號。 |
| DimensFloat | getTranslation() | 獲取組件相對于其左邊界的水平平移和相對于其上邊界的垂直平移。 |
| float | getTranslationX() | 獲取組件相對于其左側(cè)位置的水平平移。 |
| float | getTranslationY() | 獲取組件相對于其頂部位置的垂直平移。 |
| float | getTranslationZ() | 獲取該組件在垂直于屏幕方向的深度位置變化。 |
| int | getUserNextFocus(int side) | 獲取下一個要關(guān)注的組件的 ID。 |
| int[] | getVerticalPadding() | 獲取此組件的垂直填充。 |
| int[] | getVerticalPosition() | 獲取組件相對于父布局的位置。 |
| int | getVisibility() | 獲取組件的可見性。 |
| boolean | getVisibleRectOnScreen(Rect rect, int[] position) | 獲取組件相對于屏幕左上角的可見矩形區(qū)域。 |
| int | getWidth() | 獲取組件的寬度。 |
| boolean | getWindowVisibleRect(Rect visibleRect) | 獲取組件所在窗口的可見矩形。 |
| boolean | hasFocus() | 返回組件是否有焦點。 |
| boolean | hasFocusedEffect() | 檢查該組件獲得焦點時是否顯示焦點效果。 |
| boolean | hasOverlaps() | 檢查此組件是否有重疊內(nèi)容。 |
| void | hideFocusBorder() | 已棄用。 此更改自 API 版本 8 起生效。此方法是多余且臨時的,因此已棄用。 |
| void | informConfigurationChanged(Configuration config) | 調(diào)度配置更改事件。 |
| void | invalidate() | 使組件無效。 |
| boolean | isBoundaryFadeEffectEnable() | 已棄用。 此更改從 API 版本 6 開始生效。替換為 isFadeEffected(FadeEffectEnum) |
| boolean | isBoundToWindow() | 檢查組件是否已綁定到窗口。 |
| boolean | isClickable() | 返回組件是否響應(yīng)點擊事件。 |
| boolean | isClipToContourEnabled() | 檢查組件的 Contour 對象是否可用于內(nèi)容剪輯。 |
| boolean | isComponentDisplayed() | 檢查組件是否可以顯示。 |
| boolean | isEnabled() | 獲取組件的啟用狀態(tài)。 |
| boolean | isFadeEffected(Component.FadeEffectEnum fadeEffectEnum) | 檢查是否為滾動條或邊界指示器啟用了淡出效果。 |
| boolean | isFocusable() | 返回組件當(dāng)前是否可以接收焦點。 |
| boolean | isFocused() | 返回組件是否已獲得焦點。 |
| boolean | isIdentityMatrix() | 檢查當(dāng)前組件的轉(zhuǎn)換矩陣是否為單位矩陣。 |
| boolean | isLongClickOn() | 返回組件是否可長時間點擊。 |
| boolean | isPressed() | 返回組件當(dāng)前是否處于按下狀態(tài)。 |
| boolean | isRtl() | 檢查組件是否從右到左布局。 |
| boolean | isSaveStateEnabled() | 檢查此組件及其子組件是否可以保存其狀態(tài)。 |
| boolean | isScrollbarFadingOn() | 已棄用。 此更改從 API 版本 6 開始生效。替換為 isFadeEffected(FadeEffectEnum) |
| boolean | isScrollBarOn(int direction) | 檢查是否為此組件啟用了滾動條。 |
| boolean | isScrollbarOverlapEnabled() | 檢查滾動條是否與內(nèi)容重疊。 |
| boolean | isSelected() | 獲取組件的選擇狀態(tài)。 |
| boolean | isSoundEnable() | 檢查單擊此組件時是否播放聲音。 |
| boolean | isTouchFocusable() | 返回組件是否可以在觸摸模式下接收焦點。 |
| boolean | isVibrationEffectEnabled() | 檢查是否啟用了振動效果。 |
| void | notifyAccessibility(int eventType) | 觸發(fā)此組件指定的可訪問性事件。 |
| protected void | onAttributeConfigChanged(Configuration config) | 更改配置時調(diào)用。 |
| boolean | onDrag(Component component, DragEvent event) | 在將拖動事件分派到組件時調(diào)用。 |
| protected void | onRestoreState(Sequenceable state) | 當(dāng)要恢復(fù)此組件及其子組件的狀態(tài)時調(diào)用。 |
| protected void | onRtlChanged(Component.LayoutDirection layoutDirection) | 在更改任何 RTL 屬性時調(diào)用。 |
| protected Sequenceable | onSaveState() | 當(dāng)要保存此組件及其子組件的狀態(tài)時調(diào)用。 |
| boolean | performScale() | 在組件中執(zhí)行縮放事件。 |
| void | playSound(int soundId) | 播放此組件的聲音。 |
| void | postLayout() | 請求重新排列組件的布局。 |
| void | refreshContour() | 刷新組件的當(dāng)前 Contour 對象并觸發(fā) ContourRefreshedListener#onContourRefreshed(Component) 用于設(shè)置自定義 Contour 對象。 |
| void | release() | 釋放資源。 |
| void | removeBindStateChangedListener(Component.BindStateChangedListener listener) | 刪除綁定狀態(tài)更改的偵聽器。 |
| void | removeScrolledListener(Component.ScrolledListener listener) | 刪除一個監(jiān)聽滾動事件的監(jiān)聽器。 |
| boolean | requestFocus() | 請求當(dāng)前組件或其子組件之一的焦點。 |
| void | requestForceForwardTouchEvent(boolean forceForward) | 當(dāng)組件希望此父級及其祖先繼續(xù)轉(zhuǎn)發(fā)觸摸事件時調(diào)用。 |
| void | restoreComponentTreeState(PlainArraySequenceable stateContainer) | 從給定容器中恢復(fù)此組件及其子組件的狀態(tài)。 |
| void | saveComponentTreeState(PlainArraySequenceable stateContainer) | 將此組件及其子組件的狀態(tài)保存到給定容器中。 |
| void | scrollBy(int x, int y) | 設(shè)置組件滾動的偏移量。 |
| void | scrollTo(int x, int y) | 設(shè)置您希望組件滾動到的目標(biāo)位置。 |
| void | setAccessibility(int flag) | 設(shè)置可訪問性狀態(tài)。 |
| void | setAccessibilityDescription(String description) | 設(shè)置此組件的可訪問性模式的描述。 |
| void | setAlpha(float alpha) | 設(shè)置組件的 alpha 值。 |
| void | setAltitude(float altitude) | 設(shè)置此組件在垂直于屏幕的方向上的基本深度位置。 |
| void | setBackground(Element element) | 將指定元素設(shè)置為組件的背景。 |
| void | setBindStateChangedListener(Component.BindStateChangedListener listener) | 添加綁定狀態(tài)更改的偵聽器。 |
| void | setBottom(int bottom) | 設(shè)置組件相對于父容器的底部邊緣位置。 |
| void | setBoundaryFadeEffectEnable(boolean enable) | 已棄用。 此更改從 API 版本 6 開始生效。替換為 enableFadeEffect(FadeEffectEnum) 或 disableFadeEffect(FadeEffectEnum) |
| void | setCanAcceptScrollListener(Component.CanAcceptScrollListener listener) | |
| void | setCenterZoomFactor(float scaleX, float scaleY) | 設(shè)置縮放中心組件項目的縮放系數(shù)。 |
| void | setCentralScrollMode(boolean centralMode) | 設(shè)置是否啟用中央滾動模式以始終在組件中心顯示組件項。 |
| void | setClickable(boolean clickable) | 啟用或禁用組件的點擊事件。 |
| void | setClickedListener(Component.ClickedListener listener) | 為組件中的點擊事件注冊一個監(jiān)聽器。 |
| void | setClipEnabled(boolean enabled) | 設(shè)置是否允許在組件超出其父布局時自動裁剪。 |
| void | setClipToContourEnabled(boolean enable) | 設(shè)置組件的 Contour 對象是否可用于內(nèi)容裁剪。 |
| void | setComponentDescription(CharSequence componentDescription) | 設(shè)置組件中內(nèi)容的描述。 |
| void | setComponentMinSize(int minWidth, int minHeight) | 設(shè)置此組件的最小可能寬度和高度。 |
| void | setComponentPosition(int left, int top, int right, int bottom) | 設(shè)置組件相對于父容器的位置。 |
| void | setComponentPosition(Rect rect) | 根據(jù) rect 設(shè)置組件相對于父容器的位置。 |
| void | setComponentSize(int width, int height) | 設(shè)置組件大小。 |
| void | setComponentStateChangedListener(Component.ComponentStateChangedListener listener) | 設(shè)置組件狀態(tài)更改事件的偵聽器。 |
| void | setContentEnable(boolean enable) | 設(shè)置是否為組件繪制內(nèi)容。 |
| void | setContentPosition(float x, float y) | 設(shè)置繪圖和事件監(jiān)聽的位置。 |
| void | setContentPositionX(float x) | 設(shè)置繪圖和事件監(jiān)聽的 x 坐標(biāo)。 |
| void | setContentPositionY(float y) | 設(shè)置繪圖和事件監(jiān)聽的 y 坐標(biāo)。 |
| void | setContour(Contour contour) | 為組件設(shè)置自定義輪廓對象。 |
| void | setContourRefreshedListener(Component.ContourRefreshedListener listener) | 注冊一個偵聽器以獲取組件的 Contour 對象的更新。 |
| void | setDoubleClickedListener(Component.DoubleClickedListener listener) | 注冊監(jiān)聽該組件的雙擊事件。 |
| void | setDragAcceptAngle(float degree) | 設(shè)置水平或垂直拖動識別器的偏轉(zhuǎn)角度。 |
| void | setDraggedListener(int dragMode, Component.DraggedListener listener) | 為組件的拖動事件注冊一個監(jiān)聽器。 |
| void | setEditEventListener(Component.EditEventListener listener) | 注冊一個偵聽器以觀察由鍵盤快捷鍵觸發(fā)并分發(fā)到此組件的編輯事件。 |
| void | setEnabled(boolean enabled) | 設(shè)置組件的啟用狀態(tài)。 |
| protected void | setEstimatedSize(int estimatedWidth, int estimatedHeight) | 這應(yīng)該從 EstimateSizeListener#onEstimateSize(int, int) 調(diào)用以設(shè)置測量的寬度和高度。 |
| protected void | setEstimateSizeListener(Component.EstimateSizeListener listener) | 在組件的大小估計過程中添加一個偵聽器。 |
| void | setFadeEffectBoundaryWidth(int width) | 設(shè)置組件的淡入淡出效果區(qū)域的邊界寬度。 |
| void | setFadeEffectColor(Color color) | 設(shè)置產(chǎn)生淡入淡出效果時顯示的顏色。 |
| void | setFocusable(int focusable) | 設(shè)置組件是否可以接收焦點。 |
| void | setFocusBorderEnable(boolean enabled) | 設(shè)置當(dāng)該組件處于焦點時是否啟用焦點邊框。 |
| void | setFocusBorderPadding(int padding) | 設(shè)置焦點邊框和此組件之間的填充。 |
| void | setFocusBorderRadius(float radius) | 設(shè)置焦點邊框的半徑。 |
| void | setFocusBorderRadius(float[] radii) | 設(shè)置焦點邊框角的半徑。 |
| void | setFocusBorderWidth(int width) | 設(shè)置焦點邊框的寬度。 |
| void | setFocusChangedListener(Component.FocusChangedListener listener) | 為組件中的焦點更改事件注冊一個偵聽器。 |
| void | setFocusedEffect(boolean enabled) | 設(shè)置此組件獲得焦點時是否具有焦點效果。 |
| void | setForeground(Element element) | 將指定元素設(shè)置為組件的前景。 |
| void | setForegroundGravity(int foregroundGravity) | 已棄用。 此更改從 API 版本 6 開始生效。此方法是多余的,因此已棄用。 |
| void | setForwardHoverListener(Component.ForwardHoverListener listener) | 注冊一個監(jiān)聽器來決定將鼠標(biāo)懸停事件轉(zhuǎn)發(fā)給子組件。 |
| void | setForwardTouchListener(Component.ForwardTouchListener listener) | 注冊一個監(jiān)聽器來決定子組件的前向觸摸事件。 |
| void | setGesturePriority(Component.GestureType gestureType, int priority) | 設(shè)置手勢的優(yōu)先級。 |
| void | setHeight(int height) | 設(shè)置組件的高度。 |
| void | setHorizontalPadding(int left, int right) | 設(shè)置此組件的水平填充。 |
| void | setHorizontalPosition(int left, int right) | 設(shè)置組件相對于父容器的水平位置。 |
| void | setHoverEventListener(Component.HoverEventListener listener) | 為組件中的懸停事件注冊一個偵聽器。 |
| void | setId(int id) | 設(shè)置組件的唯一 ID。 |
| void | setKeyEventListener(Component.KeyEventListener listener) | 為組件中的關(guān)鍵事件注冊一個監(jiān)聽器。 |
| void | setLayoutConfig(ComponentContainer.LayoutConfig config) | 設(shè)置組件在其父布局中的布局參數(shù)。 |
| void | setLayoutDirection(Component.LayoutDirection layoutDirection) | 設(shè)置此組件的布局方向。 |
| void | setLayoutRefreshedListener(Component.LayoutRefreshedListener listener) | 為組件的重新布局注冊一個監(jiān)聽器。 |
| void | setLeft(int left) | 設(shè)置組件相對于父容器的左邊緣位置。 |
| void | setLongClickable(boolean longClickable) | 設(shè)置組件是否可長按。 |
| void | setLongClickedListener(Component.LongClickedListener listener) | 為組件中的長按事件注冊一個監(jiān)聽器(組件被單擊并按住)。 |
| void | setMarginBottom(int bottom) | 設(shè)置此組件的下邊距。 |
| void | setMarginLeft(int left) | 設(shè)置此組件的左邊距。 |
| void | setMarginRight(int right) | 設(shè)置此組件的右邊距。 |
| void | setMarginsLeftAndRight(int left, int right) | 設(shè)置此組件的水平邊距。 |
| void | setMarginsTopAndBottom(int top, int bottom) | 設(shè)置此組件的垂直邊距。 |
| void | setMarginTop(int top) | 設(shè)置此組件的上邊距。 |
| void | setMinHeight(int minHeight) | 設(shè)置組件的最小高度。 |
| void | setMinWidth(int minWidth) | 設(shè)置組件的最小可能寬度。 |
| void | setMode(int mode) | 設(shè)置此組件的顯示模式。 |
| void | setMouseEventListener(Component.MouseEventListener listener) | 為組件中的鼠標(biāo)事件注冊一個監(jiān)聽器。 |
| void | setMousePointerStyleListener(Component.MousePointerStyleListener listener) | 注冊鼠標(biāo)指針樣式更改的偵聽器。 |
| void | setName(String name) | 設(shè)置組件的名稱。 |
| void | setOnDragListener(Component.OnDragListener listener) | 為組件中的拖動事件注冊一個監(jiān)聽器。 |
| void | setPadding(int left, int top, int right, int bottom) | 設(shè)置組件的填充。 |
| void | setPaddingBottom(int bottom) | 設(shè)置此組件的底部填充。 |
| void | setPaddingLeft(int left) | 設(shè)置此組件的左側(cè)填充。 |
| void | setPaddingRelative(int start, int top, int end, int bottom) | 設(shè)置組件的相對填充。 |
| void | setPaddingRight(int right) | 為此組件設(shè)置正確的填充。 |
| void | setPaddingTop(int top) | 設(shè)置此組件的頂部填充。 |
| void | setPivot(float x, float y) | 設(shè)置樞軸(點),圍繞該組件旋轉(zhuǎn)和縮放。 |
| void | setPivot(Point point) | 設(shè)置樞軸(點),此組件基于該點旋轉(zhuǎn)和縮放。 |
| void | setPivotX(float pivotX) | 設(shè)置組件旋轉(zhuǎn)和縮放所圍繞的點的 X 軸坐標(biāo),即樞軸點。 |
| void | setPivotY(float pivotY) | 設(shè)置組件旋轉(zhuǎn)和縮放所圍繞的點,即樞軸點的 Y 軸坐標(biāo)。 |
| void | setPosition(int coordX, int coordY) | 設(shè)置組件左上角相對于父布局的位置。 |
| void | setPositionX(int coordX) | 設(shè)置組件左上角相對于父布局的 x 坐標(biāo)。 |
| void | setPositionY(int coordY) | 設(shè)置組件左上角相對于父布局的 y 坐標(biāo)。 |
| void | setPressState(boolean pressState) | 設(shè)置組件的按下狀態(tài)。 |
| void | setRight(int right) | 設(shè)置組件相對于父容器的右邊緣位置。 |
| void | setRotation(float degree) | 設(shè)置組件繞 Z 軸旋轉(zhuǎn)的度數(shù)。 |
| void | setRotationEventListener(Component.RotationEventListener listener) | 為組件中的旋轉(zhuǎn)事件注冊一個監(jiān)聽器。 |
| void | setRotationSensitivity(float value) | 設(shè)置組件的旋轉(zhuǎn)靈敏度。 |
| void | setScale(float x, float y) | 圍繞樞軸設(shè)置組件的比例因子。 |
| void | setScaledListener(Component.ScaledListener listener) | 為組件的縮放事件注冊一個監(jiān)聽器。 |
| void | setScaleX(float scaleX) | 圍繞樞軸點設(shè)置組件在 X 方向上的縮放因子。 |
| void | setScaleY(float scaleY) | 圍繞樞軸點設(shè)置組件在 Y 方向上的縮放因子。 |
| void | setScrollbarBackgroundColor(Color color) | 設(shè)置滾動條的背景顏色。 |
| void | setScrollbarColor(Color color) | 設(shè)置滾動條的顏色。 |
| void | setScrollbarFadingDelay(int delay) | 設(shè)置滾動條消失之前的延遲。 |
| void | setScrollbarFadingDuration(int duration) | 設(shè)置滾動條的淡出持續(xù)時間。 |
| void | setScrollbarFadingEnabled(boolean enabled) | 已棄用。 此更改從 API 版本 6 開始生效。替換為 enableFadeEffect(FadeEffectEnum) 或 disableFadeEffect(FadeEffectEnum) |
| void | setScrollBarMode(int scrollBarMode) | 設(shè)置正在顯示的滾動條的模式。 |
| void | setScrollbarOverlapEnabled(boolean enabled) | 設(shè)置滾動條是否與內(nèi)容重疊。 |
| void | setScrollbarRadius(float radius) | 設(shè)置滾動條圓角邊框的半徑。 |
| void | setScrollbarRoundRect(boolean isRoundRect) | 設(shè)置滾動條的形狀。 |
| void | setScrollbarStartAngle(float start) | 設(shè)置圓形滾動條的起始角度。 |
| void | setScrollbarSweepAngle(float sweep) | 設(shè)置圓形滾動條的掃角。 |
| void | setScrollbarThickness(int thickness) | 設(shè)置滾動條的粗細(xì)。 |
| void | setScrolledListener(Component.ScrolledListener listener) | 為組件中的滾動事件注冊一個監(jiān)聽器。 |
| void | setSelected(boolean selected) | 設(shè)置組件的選擇狀態(tài)。 |
| void | setShadowColor(Color color) | 設(shè)置組件的陰影顏色。 |
| void | setShadowStyle(Component.ShadowSize size, Component.ShadowMode mode, Component.ShadowDevice device) | 將指定元素設(shè)置為組件的陰影樣式。 |
| void | setSoundEnable(boolean enable) | 單擊此組件時啟用或禁用該組件的聲音。 |
| void | setSpeechEventListener(Component.SpeechEventListener listener) | 設(shè)置此組件中語音事件的偵聽器。 |
| void | setTag(Object tag) | 設(shè)置與組件關(guān)聯(lián)的標(biāo)簽。 |
| void | setTop(int top) | 設(shè)置組件相對于父容器的頂部邊緣位置。 |
| void | setTouchEventListener(Component.TouchEventListener listener) | 為組件中的觸摸事件注冊一個監(jiān)聽器。 |
| void | setTouchFocusable(boolean focusable) | 設(shè)置組件在觸摸模式下是否可以接收焦點。 |
| void | setTransitionSymbol(String symbol) | 設(shè)置過渡符號。 |
| void | setTranslation(float x, float y) | 設(shè)置組件相對于其左邊界的水平平移和相對于其上邊界的垂直平移。 |
| void | setTranslationX(float translationX) | 設(shè)置組件相對于其左側(cè)位置的水平位置。 |
| void | setTranslationY(float translationY) | 設(shè)置組件相對于其頂部位置的垂直位置。 |
| void | setTranslationZ(float translationZ) | 設(shè)置該組件在垂直于屏幕方向的深度位置變化。 |
| void | setUnconsumedKeyEventListener(Component.UnconsumedKeyEventListener listener) | 為組件中未使用的鍵事件注冊一個偵聽器。 |
| void | setUserNextFocus(int side, int id) | 設(shè)置要關(guān)注的下一個組件。 |
| void | setVerticalPadding(int top, int bottom) | 設(shè)置此組件的垂直填充。 |
| void | setVerticalPosition(int top, int bottom) | 設(shè)置組件相對于父容器的垂直位置。 |
| void | setVibrationEffectEnabled(boolean enabled) | 設(shè)置是否開啟震動效果。 |
| void | setVisibility(int visibility) | 設(shè)置組件的可見性。 |
| void | setWidth(int width) | 設(shè)置組件的寬度。 |
| void | showFocusBorder() | 已棄用。 此更改自 API 版本 8 起生效。此方法是多余且臨時的,因此已棄用。 |
| boolean | simulateClick() | 在組件中執(zhí)行單擊事件。 |
| boolean | simulateDrag() | 執(zhí)行組件的拖動事件。 |
| boolean | startDragAndDrop(MimeData data, Component.DragFeedbackProvider shadowProvider) | 開始拖動組件。 |
| void | subscribeVoiceEvents(Component.VoiceEvent voiceEvent) | 訂閱該組件的指定語音事件。 |
| void | unsubscribeVoiceEvents() | 一次取消訂閱當(dāng)前組件訂閱的所有語音事件。 |
| 從類 java.lang.Object 繼承的方法 |
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
字段詳細(xì)信息
ACCESSIBILITY_ADAPTABLE
public static final int ACCESSIBILITY_ADAPTABLE
表示可以訪問該組件。
ACCESSIBILITY_DISABLE
public static final int ACCESSIBILITY_DISABLE
表示無法訪問該組件。
ACCESSIBILITY_ENABLE
public static final int ACCESSIBILITY_ENABLE
表示該組件已啟用。
AXIS_X
public static final int AXIS_X
表示 x 軸。
AXIS_Y
public static final int AXIS_Y
表示 y 軸。
CONTOUR_BACKGROUND
public static final Component.ContourRefreshedListener CONTOUR_BACKGROUND
組件的默認(rèn) ContourRefreshedListener。 如果背景元素已經(jīng)設(shè)置到當(dāng)前組件中,則從元素中獲取輪廓并設(shè)置到組件中。 否則,設(shè)置與組件大小相同的透明輪廓。
CONTOUR_BORDER
public static final Component.ContourRefreshedListener CONTOUR_BORDER
提供與組件矩形邊框匹配的輪廓。
CONTOUR_PADDING_BORDER
public static final Component.ContourRefreshedListener CONTOUR_PADDING_BORDER
提供與組件的矩形填充邊框匹配的輪廓。
DEFAULT_SCALE
public static final float DEFAULT_SCALE
表示縮放組件的默認(rèn)縮放系數(shù)。
DRAG_DOWN
public static final int DRAG_DOWN
表示向下拖動滾動條。
DRAG_HORIZONTAL
public static final int DRAG_HORIZONTAL
表示水平拖動滾動條。
DRAG_HORIZONTAL_VERTICAL
public static final int DRAG_HORIZONTAL_VERTICAL
表示滾動條水平和垂直拖動。
DRAG_LEFT
public static final int DRAG_LEFT
表示向左拖動滾動條。
DRAG_RIGHT
public static final int DRAG_RIGHT
表示向右拖動滾動條。
DRAG_UP
public static final int DRAG_UP
表示向上拖動滾動條。
DRAG_VERTICAL
public static final int DRAG_VERTICAL
表示垂直拖動滾動條。
EVENT_TYPE_COMPONENT_ACCESSIBILITY_FOCUSED
public static final int EVENT_TYPE_COMPONENT_ACCESSIBILITY_FOCUSED
表示一個事件,指示獲得了可訪問性焦點。
EVENT_TYPE_COMPONENT_ACCESSIBILITY_FOCUSED_CLEAR
public static final int EVENT_TYPE_COMPONENT_ACCESSIBILITY_FOCUSED_CLEAR
表示一個事件,指示清除輔助功能焦點。
EVENT_TYPE_COMPONENT_CLICKED
public static final int EVENT_TYPE_COMPONENT_CLICKED
表示一個指示組件被單擊的事件。
EVENT_TYPE_COMPONENT_FOCUSED
public static final int EVENT_TYPE_COMPONENT_FOCUSED
表示一個指示組件獲得焦點的事件。
EVENT_TYPE_COMPONENT_LONG_CLICKED
public static final int EVENT_TYPE_COMPONENT_LONG_CLICKED
表示一個指示組件被長按的事件。
EVENT_TYPE_COMPONENT_SCROLLED
public static final int EVENT_TYPE_COMPONENT_SCROLLED
表示一個指示組件滾動的事件。
EVENT_TYPE_COMPONENT_SELECTED
public static final int EVENT_TYPE_COMPONENT_SELECTED
表示一個指示組件被選中的事件。
EVENT_TYPE_COMPONENT_TEXT_UPDATE
public static final int EVENT_TYPE_COMPONENT_TEXT_UPDATE
表示指示 Text 組件中的文本已更改的事件。
EVENT_TYPE_NOTICE
public static final int EVENT_TYPE_NOTICE
表示指示應(yīng)用程序發(fā)送通知的事件。
EVENT_TYPE_NOTIFICATION_STATE_UPDATE
public static final int EVENT_TYPE_NOTIFICATION_STATE_UPDATE
表示指示顯示通知的事件。
EVENT_TYPE_TOAST_SHOW
public static final int EVENT_TYPE_TOAST_SHOW
表示指示顯示 toast 的事件。
EVENT_TYPE_WINDOW_STATE_UPDATE
public static final int EVENT_TYPE_WINDOW_STATE_UPDATE
表示指示窗口狀態(tài)已更新的事件。
FOCUS_ADAPTABLE
public static final int FOCUS_ADAPTABLE
組件自行決定可聚焦性。 這是默認(rèn)狀態(tài)。 此常量用作 setFocusable(int) 的參數(shù)。
FOCUS_DISABLE
public static final int FOCUS_DISABLE
該組件不需要擊鍵。 此常量用作 setFocusable(int) 的參數(shù)。
FOCUS_ENABLE
public static final int FOCUS_ENABLE
該組件需要擊鍵。 此常量用作 setFocusable(int) 的參數(shù)。
FOCUS_NEXT
public static final int FOCUS_NEXT
將焦點移至下一個可點擊項目。 此常量用作 findNextFocusableComponent(int) 的參數(shù)。
FOCUS_PREVIOUS
public static final int FOCUS_PREVIOUS
將焦點移到上一個可點擊項目。 此常量用作 findNextFocusableComponent(int) 的參數(shù)。
FOCUS_SIDE_BOTTOM
public static final int FOCUS_SIDE_BOTTOM
向下移動焦點。 此常量用作 findNextFocusableComponent(int) 的參數(shù)。
FOCUS_SIDE_LEFT
public static final int FOCUS_SIDE_LEFT
將焦點移到左側(cè)。 此常量用作 findNextFocusableComponent(int) 的參數(shù)。
FOCUS_SIDE_RIGHT
public static final int FOCUS_SIDE_RIGHT
將焦點向右移動。 此常量用作 findNextFocusableComponent(int) 的參數(shù)。
FOCUS_SIDE_TOP
public static final int FOCUS_SIDE_TOP
上移焦點。 此常量用作 findNextFocusableComponent(int) 的參數(shù)
網(wǎng)頁標(biāo)題:創(chuàng)新互聯(lián)鴻蒙OS教程:鴻蒙OSComponent
網(wǎng)站鏈接:http://fisionsoft.com.cn/article/dhohojh.html


咨詢
建站咨詢
