鸿蒙OS开发文档 第21页

鸿蒙OS Text

Text java.lang.Object |—ohos.agp.components.Component |—|—ohos.agp.components.Text public class Text extends Component 显示组件中的文本。 文本是基本的 UI 元素。 Since: 3 嵌套类摘要 修饰符和类型 类 描述 static class Text.ConversionType 枚举转换类型。 static interface Text.EditorActionListener 侦听编辑器操作的更改事件。 static class Text.FontFamilyType 枚举字体系列类型。 static interface Text.TextColorObserver 提供一个观察者来监听组件中的文本颜色变化。 static interface Text.TextObserver 提供一个文本观察器来观察组件中的文本变化。 static interface Text.TextSizeObserver 提供一个观察者来监听组件中文本大小的变化。 static class Text.TextSizeType 枚举文本大小的类型。 static class Text.TruncationMode 指示如何截断文本。 从类 ohos.agp.components.Component 继承的嵌套类/接口 Component.BindStateChangedListener, Component.CanAcceptScrollListener, Component.ClickedListener, Component.ComponentStateChangedListener, Component.ContourRefreshedListener, Component.DefSpeechEventListener, Component.DoubleClickedListener, Component.DragFeedbackProvider, Component.DraggedListener, Component.DrawTask, Component.EditEventListener, Component.EstimateSizeListener, Component.EstimateSpec, Component.FadeEffectEnum, Component.FocusChangedListener, Component.ForwardHoverListener, Component.ForwardTouchListener, Component.GestureType, Component.HoverEventListener, Component.KeyEventListener, Component.LayoutDirection, Component.LayoutRefreshedListener, Component.LongClickedListener, Component.MeasureSpec, Component.MouseEventListener, Component.MousePointerStyleListener, Component.OnDragListener, Component.RotationEventListener, Component.ScaledListener, Component.ScrolledListener, Component.ShadowDevice, Component.ShadowMode, Component.ShadowSize, Component.SpeechEventListener, Component.TouchEventListener, Component.UnconsumedKeyEventListener, Component.VoiceEvent 字段摘要 修饰符和类型 字段 描述 static int AUTO_CURSOR_POSITION 表示光标所在的位置。 static int AUTO_SCROLLING_FOREVER 表示文本将始终处于自动滚动状态。 从类 ohos.agp.components.Component 继承的字段 ACCESSIBILITY_ADAPTABLE, ACCESSIBILITY_DISABLE, ACCESSIBILITY_ENABLE, AXIS_X, AXIS_Y, CONTOUR_BACKGROUND, CONTOUR_BORDER, CONTOUR_PADDING_BORDER, DEFAULT_SCALE, DRAG_DOWN, DRAG_HORIZONTAL, DRAG_HORIZONTAL_VERTICAL, DRAG_LEFT, DRAG_RIGHT, DRAG_UP, DRAG_VERTICAL, EVENT_TYPE_COMPONENT_ACCESSIBILITY_FOCUSED, EVENT_TYPE_COMPONENT_ACCESSIBILITY_FOCUSED_CLEAR, EVENT_TYPE_COMPONENT_CLICKED, EVENT_TYPE_COMPONENT_FOCUSED, EVENT_TYPE_COMPONENT_LONG_CLICKED, EVENT_TYPE_COMPONENT_SCROLLED, EVENT_TYPE_COMPONENT_SELECTED, EVENT_TYPE_COMPONENT_TEXT_UPDATE, EVENT_TYPE_NOTICE, EVENT_TYPE_NOTIFICATION_STATE_UPDATE, EVENT_TYPE_TOAST_SHOW, EVENT_TYPE_WINDOW_STATE_UPDATE, FOCUS_ADAPTABLE, FOCUS_DISABLE, FOCUS_ENABLE, FOCUS_NEXT, FOCUS_PREVIOUS, FOCUS_SIDE_BOTTOM, FOCUS_SIDE_LEFT, FOCUS_SIDE_RIGHT, FOCUS_SIDE_TOP, HIDE, HORIZONTAL, ID_DEFAULT, INHERITED_MODE, INVISIBLE, mBackgroundElement, mCanvasForTaskOverContent, mCanvasForTaskUnderContent, mComponentParent, mContext, mDrawTaskOverContent, mDrawTaskUnderContent, mEstimateSizeListener, mForegroundElement, mForwardHoverListener, mHoverEventListener, mKeyEventListener, mMouseEventListener, mPosition, mRotationEventListener, mShadowElement, mUnconsumedKeyEventListener, OVAL_MODE, OVAL_SCROLL_BAR_MODE, POSITION_X_INDEX, POSITION_Y_INDEX, RECT_MODE, RECT_SCROLL_BAR_MODE, SCROLL_AUTO_STAGE, SCROLL_IDLE_STAGE, SCROLL_NORMAL_STAGE, UNSPECIFIED_SCROLL_BAR_MODE, VERTICAL, VISIBLE 构造函数摘要 构造函数 描述 Text(Context context) 默认构造函数用于使用默认属性集和样式创建 Text 实例。 Text(Context context, AttrSet attrSet) 用于在 XML 文件解析后使用指定的属性集和默认样式创建 Text 实例的构造函数。 Text(Context context, AttrSet attrSet, String styleName) 用于在 XML 文件解析后使用指定的属性集和指定的样式创建 Text 实例的构造函数。 方法总结 修饰符和类型 方法 描述 void addTextObserver(Text.TextObserver observer) 添加文本观察器 TextObserver 以检测文本是否更改。 boolean adjustCursorPosition() 检查光标是否可以移动到可见位置。 void append(String text) 将文本字符串附加到文本组件中的现有文本。 void delete(int length) 删除光标前的文本。 void delete(int length, boolean back) 删除光标之前或之后的文本。 void delete(int length, boolean back, int pos) 从指定位置删除文本。 float getAdditionalLineSpacing() 获取添加到文本组件中每行高度的额外间距。 Element[] getAroundElements() 获取文本周围的元素对象。 int getAroundElementsPadding() 获取文本和元素对象之间的填充。 Element[] getAroundElementsRelative() 获取文本周围的元素对象。 int[] getAutoFontSizeRule() 获取自动调整大小的规则。 int getAutoFontSizeStep() 获取自动调整大小的步骤。 int getAutoScrollingCount() 获取文本的自动滚动次数。 long getAutoScrollingDuration() 获取文本的自动滚动时长。 int getBaseLine(int line) 获取目标线基线的 y 坐标。 Element...

鸿蒙OS TabList.Tab

TabList.Tab java.lang.Object |—ohos.agp.components.Component |—|—ohos.agp.components.Text |—|—|—ohos.agp.components.TabList.Tab public class TabList.Tab extends Text 表示 TabList 中的选项卡。 您可以使用 TabList 对象来创建 Tab 对象。 Since: 3 嵌套类摘要 从类 ohos.agp.components.Component 继承的嵌套类/接口 Component.BindStateChangedListener, Component.CanAcceptScrollListener, Component.ClickedListener, Component.ComponentStateChangedListener, Component.ContourRefreshedListener, Component.DefSpeechEventListener, Component.DoubleClickedListener, Component.DragFeedbackProvider, Component.DraggedListener, Component.DrawTask, Component.EditEventListener, Component.EstimateSizeListener, Component.EstimateSpec, Component.FadeEffectEnum, Component.FocusChangedListener, Component.ForwardHoverListener, Component.ForwardTouchListener, Component.GestureType, Component.HoverEventListener, Component.KeyEventListener, Component.LayoutDirection, Component.LayoutRefreshedListener, Component.LongClickedListener, Component.MeasureSpec, Component.MouseEventListener, Component.MousePointerStyleListener, Component.OnDragListener, Component.RotationEventListener, Component.ScaledListener, Component.ScrolledListener, Component.ShadowDevice, Component.ShadowMode, Component.ShadowSize, Component.SpeechEventListener, Component.TouchEventListener, Component.UnconsumedKeyEventListener, Component.VoiceEvent 从类 ohos.agp.components.Text 继承的嵌套类/接口 Text.ConversionType, Text.EditorActionListener, Text.FontFamilyType, Text.TextColorObserver, Text.TextObserver, Text.TextSizeObserver, Text.TextSizeType, Text.TruncationMode 字段摘要 从类 ohos.agp.components.Component 继承的字段 ACCESSIBILITY_ADAPTABLE, ACCESSIBILITY_DISABLE, ACCESSIBILITY_ENABLE, AXIS_X, AXIS_Y, CONTOUR_BACKGROUND, CONTOUR_BORDER, CONTOUR_PADDING_BORDER, DEFAULT_SCALE, DRAG_DOWN, DRAG_HORIZONTAL, DRAG_HORIZONTAL_VERTICAL, DRAG_LEFT, DRAG_RIGHT, DRAG_UP, DRAG_VERTICAL, EVENT_TYPE_COMPONENT_ACCESSIBILITY_FOCUSED, EVENT_TYPE_COMPONENT_ACCESSIBILITY_FOCUSED_CLEAR, EVENT_TYPE_COMPONENT_CLICKED, EVENT_TYPE_COMPONENT_FOCUSED, EVENT_TYPE_COMPONENT_LONG_CLICKED, EVENT_TYPE_COMPONENT_SCROLLED, EVENT_TYPE_COMPONENT_SELECTED, EVENT_TYPE_COMPONENT_TEXT_UPDATE, EVENT_TYPE_NOTICE, EVENT_TYPE_NOTIFICATION_STATE_UPDATE, EVENT_TYPE_TOAST_SHOW, EVENT_TYPE_WINDOW_STATE_UPDATE, FOCUS_ADAPTABLE, FOCUS_DISABLE, FOCUS_ENABLE, FOCUS_NEXT, FOCUS_PREVIOUS, FOCUS_SIDE_BOTTOM, FOCUS_SIDE_LEFT, FOCUS_SIDE_RIGHT, FOCUS_SIDE_TOP, HIDE, HORIZONTAL, ID_DEFAULT, INHERITED_MODE, INVISIBLE, mBackgroundElement, mCanvasForTaskOverContent, mCanvasForTaskUnderContent, mComponentParent, mContext, mDrawTaskOverContent, mDrawTaskUnderContent, mEstimateSizeListener, mForegroundElement, mForwardHoverListener, mHoverEventListener, mKeyEventListener, mMouseEventListener, mPosition, mRotationEventListener, mShadowElement, mUnconsumedKeyEventListener, OVAL_MODE, OVAL_SCROLL_BAR_MODE, POSITION_X_INDEX, POSITION_Y_INDEX, RECT_MODE, RECT_SCROLL_BAR_MODE, SCROLL_AUTO_STAGE, SCROLL_IDLE_STAGE, SCROLL_NORMAL_STAGE, UNSPECIFIED_SCROLL_BAR_MODE, VERTICAL, VISIBLE 从类 ohos.agp.components.Text 继承的字段 AUTO_CURSOR_POSITION, AUTO_SCROLLING_FOREVER 构造函数摘要 构造函数 描述 Tab(Context context) 用于使用默认属性集和样式创建 Tab 实例的默认构造函数。 Tab(Context context, AttrSet attrSet) 用于在 XML 文件解析后使用指定的属性集和默认样式创建 Tab 实例的构造函数。 Tab(Context context, AttrSet attrSet, String styleName) 用于在 XML 文件解析后使用指定的属性集和指定的样式创建 Tab 实例的构造函数。 方法总结 修饰符和类型 方法 描述 Element getIconElement() 获取选项卡上显示的图标。 int getPosition() 获取选项卡在 TabList 中的位置。 TabList.Tab select() 选择一个选项卡。 TabList.Tab setIconElement(Element leftIcon) 设置选项卡上显示的元素图标。 从类 ohos.agp.components.Component 继承的方法 addDrawTask, addDrawTask, addScrolledListener, announceAccessibility, arrange, bindCornerMark, callOnClick, canScroll, clearFocus, createAnimatorProperty, disableFadeEffect, dispatchRestoreState, dispatchSaveState, draw, enableCornerMark, enableFadeEffect, enableSaveState, enableScrollBar, estimateSize, executeDoubleClick, executeLongClick, findComponentById, findComponentHolderById, findFocus, findNextFocusableComponent, findRequestNextFocus, getAccessibility, getAccessibilityDescription, getAlpha, getAltitude, getBackgroundElement, getBaseLine, getBottom, getBoundaryFadeEffectBottomRate, getBoundaryFadeEffectLeftRate, getBoundaryFadeEffectRightRate, getBoundaryFadeEffectTopRate, getCenterZoomFactor, getCentralScrollMode, getClickedListener, getClipEnabled, getComponentDescription, getComponentMinSize, getComponentParent, getComponentPosition, getComponentSize, getComponentStateChangedListener, getComponentTreeObserver, getContentEnable, getContentPosition, getContentPositionX, getContentPositionY, getContext, getContour, getContourRefreshedListener, getCornerMark, getDragAcceptAngle, getDraggedListener, getEditEventListener, getEstimatedHeight, getEstimatedWidth, getFadeEffectColor, getFocusable, getFocusBorderEnable, getFocusBorderPadding, getFocusBorderRadius, getFocusBorderWidth, getForegroundElement, getForegroundGravity, getForwardHoverListener, getForwardTouchListener, getGesturePriority, getHeight, getHorizontalPadding, getHorizontalPosition, getHoverEventListener, getId, getKeyEventListener, getLayoutConfig, getLayoutDirection, getLayoutDirectionResolved, getLayoutRefreshedListener, getLeft, getLocationOnScreen, getMarginBottom, getMarginLeft, getMarginRight, getMargins, getMarginsLeftAndRight, getMarginsTopAndBottom, getMarginTop, getMatrix, getMinHeight, getMinWidth, getMode, getModeResolved, getMouseEventListener, getMousePointerStyleListener, getName, getPadding, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getPivot, getPivotX, getPivotY, getResourceManager, getRight, getRotation, getRotationEventListener, getRotationSensitivity, getScale, getScaledListener, getScaleX, getScaleY, getScrollbarBackgroundColor, getScrollbarColor, getScrollbarFadingDelay, getScrollbarFadingDuration, getScrollBarMode, getScrollbarRadius, getScrollbarRoundRect, getScrollbarStartAngle, getScrollbarSweepAngle, getScrollbarThickness, getScrollState, getScrollValue, getSelfVisibleRect, getShadowColor, getSpeechEventListener, getTag, getTop, getTouchEventListener, getTransitionSymbol, getTranslation, getTranslationX, getTranslationY, getTranslationZ, getUserNextFocus, getVerticalPadding, getVerticalPosition, getVisibility, getVisibleRectOnScreen, getWidth, getWindowVisibleRect, hasFocus, hasFocusedEffect, hasOverlaps, hideFocusBorder, informConfigurationChanged, invalidate, isBoundaryFadeEffectEnable, isBoundToWindow, isClickable, isClipToContourEnabled, isComponentDisplayed, isEnabled, isFadeEffected, isFocusable, isFocused, isIdentityMatrix, isLongClickOn, isPressed, isRtl, isSaveStateEnabled, isScrollbarFadingOn, isScrollBarOn, isScrollbarOverlapEnabled, isSelected, isSoundEnable, isTouchFocusable, isVibrationEffectEnabled, notifyAccessibility, onAttributeConfigChanged, onDrag, onRestoreState, onSaveState, performScale, playSound, postLayout, refreshContour, release, removeBindStateChangedListener, removeScrolledListener, requestFocus, requestForceForwardTouchEvent, restoreComponentTreeState, saveComponentTreeState, scrollBy, scrollTo, setAccessibility, setAccessibilityDescription, setAlpha, setAltitude, setBackground, setBindStateChangedListener, setBottom, setBoundaryFadeEffectEnable, setCanAcceptScrollListener, setCenterZoomFactor, setCentralScrollMode, setClickable, setClickedListener, setClipEnabled, setClipToContourEnabled, setComponentDescription, setComponentMinSize, setComponentPosition, setComponentPosition, setComponentSize, setComponentStateChangedListener, setContentEnable, setContentPosition, setContentPositionX, setContentPositionY, setContour, setContourRefreshedListener, setDoubleClickedListener, setDragAcceptAngle, setDraggedListener, setEditEventListener, setEnabled, setEstimatedSize, setEstimateSizeListener, setFadeEffectColor, setFocusable, setFocusBorderEnable, setFocusBorderPadding, setFocusBorderRadius, setFocusBorderRadius, setFocusBorderWidth, setFocusChangedListener, setFocusedEffect, setForeground, setForegroundGravity, setForwardHoverListener, setForwardTouchListener, setGesturePriority, setHeight, setHorizontalPadding, setHorizontalPosition, setHoverEventListener, setId, setKeyEventListener, setLayoutConfig, setLayoutDirection, setLayoutRefreshedListener, setLeft, setLongClickable, setLongClickedListener, setMarginBottom, setMarginLeft, setMarginRight, setMarginsLeftAndRight, setMarginsTopAndBottom, setMarginTop, setMinHeight, setMinWidth, setMode, setMouseEventListener, setMousePointerStyleListener, setName, setOnDragListener, setPadding, setPaddingBottom, setPaddingLeft, setPaddingRelative, setPaddingRight, setPaddingTop, setPivot, setPivot, setPivotX, setPivotY, setPosition, setPositionX, setPositionY, setPressState, setRight, setRotation, setRotationEventListener, setRotationSensitivity, setScale, setScaledListener, setScaleX, setScaleY, setScrollbarBackgroundColor, setScrollbarColor, setScrollbarFadingDelay, setScrollbarFadingDuration, setScrollbarFadingEnabled, setScrollBarMode, setScrollbarOverlapEnabled, setScrollbarRadius, setScrollbarRoundRect, setScrollbarStartAngle, setScrollbarSweepAngle, setScrollbarThickness, setScrolledListener, setSelected, setShadowColor, setShadowStyle, setSoundEnable, setSpeechEventListener, setTag, setTop, setTouchEventListener, setTouchFocusable, setTransitionSymbol, setTranslation, setTranslationX, setTranslationY, setTranslationZ, setUnconsumedKeyEventListener, setUserNextFocus, setVerticalPadding, setVerticalPosition, setVibrationEffectEnabled, setVisibility, setWidth, showFocusBorder, simulateClick, simulateDrag, startDragAndDrop, subscribeVoiceEvents, unsubscribeVoiceEvents 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 从类 ohos.agp.components.Text 继承的方法 addTextObserver, adjustCursorPosition, append, delete, delete, delete, getAdditionalLineSpacing, getAroundElements, getAroundElementsPadding, getAroundElementsRelative, getAutoFontSizeRule, getAutoFontSizeStep, getAutoScrollingCount, getAutoScrollingDuration, getBaseLine, getBottomElement, getBottonElement, getBoundingRect, getBubbleElement, getBubbleHeight, getBubbleWidth, getCombinedPaddingBottom, getCombinedPaddingEnd, getCombinedPaddingLeft, getCombinedPaddingRight, getCombinedPaddingStart, getCombinedPaddingTop, getCursorElement, getCustomInputMethodOptions, getEditableString, getEditingText, getEditorAction, getEditorActionText, getEndElement, getExtraInputData, getFadeEffectBoundaryWidth, getFont, getFontFamilyType, getFontFeatures, getFontVariations, getHint, getHintColor, getHyphenationStrategy, getInputFilters, getInputMethodLocales, getInputMethodOption, getJustifyStrategy, getLeftElement, getLetterSpacing, getLineBreakStrategy, getLineCount, getLineHeight, getLocales, getMaxAutoFontSize, getMaxTextHeight, getMaxTextLines, getMaxTextWidth, getMaxWidthInEms, getMinAutoFontSize, getMinTextHeight, getMinTextLines, getMinTextWidth, getMinWidthInEms, getNumOfFontHeight, getOffsetByCoordinates, getPaddingForText, getPrimaryLocale, getRichText, getRightElement, getSelectionColor, getSelectionEnd, getSelectionLeftBubbleElement, getSelectionLeftBubbleHeight, getSelectionLeftBubbleWidth, getSelectionRightBubbleElement, getSelectionRightBubbleHeight, getSelectionRightBubbleWidth, getSelectionStart, getStartElement, getText, getTextAlignment, getTextColor, getTextConversion, getTextDirectionStrategy, getTextHorizontalScale, getTextInputType, getTextShadowColor, getTextShadowOffsetX, getTextShadowOffsetY, getTextShadowRadius, getTextSize, getTextSize, getTextToBottomSpace, getTextToTopSpace, getTopElement, getTruncationMode, getUrls, insert, insert, isAdjustInputPanel, isAllUpperCase, isAutoFontSize, isAutoSelectEnabled, isEditable, isFallbackFontMetricsEnabled, isFocusedByTouch, isHyperLinkClickable, isInputMethodActive, isMultipleLine, isScrollable, isSoftInputVisibleOnFocus, isTextCursorVisible, isTextSelectable, length, lockEditingState, moveToPosition, onCustomInputMethodCommand, onLockEditingState, onRtlChanged, onTextEditorAction, onUnlockEditingState, removeTextObserver, setAdjustInputPanel, setAroundElements, setAroundElementsPadding, setAroundElementsRelative, setAutoCursorAdjustmentEnabled, setAutoFontSize, setAutoFontSize, setAutoFontSizeRule, setAutoFontSizeRule, setAutoScrollingCount, setAutoScrollingDuration, setAutoSelectEnabled, setBubbleElement, setBubbleElement, setBubbleHeight, setBubbleSize, setBubbleWidth, setCursorElement, setCursorElement, setCursorPosition, setCustomInputMethodOptions, setEditable, setEditorActionListener, setEditorActionText, setExtraInputData, setFadeEffectBoundaryWidth, setFallbackFontMetricsEnabled, setFont, setFontFamilyType, setFontFeatures, setFontVariations, setHint, setHint, setHintColor, setHyperLinkClickable, setHyperLinkColor, setHyphenationStrategy, setInputFilters, setInputMethodLocales, setInputMethodOption, setJustifyStrategy, setLeftBubbleHeight, setLeftBubbleSize, setLeftBubbleWidth, setLetterSpacing, setLineBreakStrategy, setLineHeight, setLines, setLineSpacing, setLocales, setMaxCharacters, setMaxTextHeight, setMaxTextLines, setMaxTextWidth, setMaxWidthInEms, setMinTextHeight, setMinTextLines, setMinTextWidth, setMinWidthInEms, setMultipleLine, setPaddingForText, setPrimaryLocale, setRichText, setRightBubbleHeight, setRightBubbleSize, setRightBubbleWidth, setScrollable, setSelection, setSelectionColor, setSelectionLeftBubbleElement, setSelectionLeftBubbleElement, setSelectionRightBubbleElement, setSelectionRightBubbleElement, setSoftInputVisibleOnFocus, setText, setText, setTextAlignment, setTextColor, setTextConversion, setTextCursorVisible, setTextDirectionStrategy, setTextHeight, setTextHorizontalScale, setTextInputType, setTextSelectable, setTextShadow, setTextSize, setTextSize, setTextWidth, setTextWidthInEms, setTruncationMode, startAutoScrolling, stopAutoScrolling, unlockEditingState 构造函数详细信息 Tab public Tab(Context context) 用于使用默认属性集和样式创建 Tab 实例的默认构造函数。 参数: 参数名称 参数描述 context 指示应用程序上下文。 Tab public Tab(Context context, AttrSet attrSet) 用于在 XML 文件解析后使用指定的属性集和默认样式创建 Tab 实例的构造函数。 参数: 参数名称 参数描述 context 指示应用程序上下文。 attrSet 指示要使用的属性集。 Tab public Tab(Context context, AttrSet attrSet, String styleName) 用于在 XML 文件解析后使用指定的属性集和指定的样式创建 Tab 实例的构造函数。 参数:...

鸿蒙OS TabList

TabList java.lang.Object |—ohos.agp.components.Component |—|—ohos.agp.components.ComponentContainer |—|—|—ohos.agp.components.StackLayout |—|—|—|—ohos.agp.components.ScrollView |—|—|—|—|—ohos.agp.components.TabList public class TabList extends ScrollView 显示选项卡的方向布局,并允许布局中的内容沿布局方向滚动。 您可以使用 TabList 对象创建选项卡,然后使用 addTab(ohos.agp.components.TabList.Tab) 将新选项卡添加到列表中。 布局方向可以是 Component.HORIZONTAL 或 Component.VERTICAL。 默认方向是水平的。 Since: 3 嵌套类摘要 修饰符和类型 类 描述 class TabList.Tab 表示 TabList 中的选项卡。 static interface TabList.TabSelectedListener 提供选项卡选择的侦听器。 从类 ohos.agp.components.Component 继承的嵌套类/接口 Component.BindStateChangedListener, Component.CanAcceptScrollListener, Component.ClickedListener, Component.ComponentStateChangedListener, Component.ContourRefreshedListener, Component.DefSpeechEventListener, Component.DoubleClickedListener, Component.DragFeedbackProvider, Component.DraggedListener, Component.DrawTask, Component.EditEventListener, Component.EstimateSizeListener, Component.EstimateSpec, Component.FadeEffectEnum, Component.FocusChangedListener, Component.ForwardHoverListener, Component.ForwardTouchListener, Component.GestureType, Component.HoverEventListener, Component.KeyEventListener, Component.LayoutDirection, Component.LayoutRefreshedListener, Component.LongClickedListener, Component.MeasureSpec, Component.MouseEventListener, Component.MousePointerStyleListener, Component.OnDragListener, Component.RotationEventListener, Component.ScaledListener, Component.ScrolledListener, Component.ShadowDevice, Component.ShadowMode, Component.ShadowSize, Component.SpeechEventListener, Component.TouchEventListener, Component.UnconsumedKeyEventListener, Component.VoiceEvent 从类 ohos.agp.components.ComponentContainer 继承的嵌套类/接口 ComponentContainer.ArrangeListener 从类 ohos.agp.components.ScrollView 继承的嵌套类/接口 ScrollView.ReboundEffectParams 从类 ohos.agp.components.StackLayout 继承的嵌套类/接口 StackLayout.LayoutConfig 字段摘要 修饰符和类型 字段 描述 static int INDICATOR_BOTTOM_LINE 表示选择指示器是选项卡的底线。 static int INDICATOR_INVISIBLE 表示选择指示器已隐藏。 static int INDICATOR_LEFT_LINE 表示选择指示器是选项卡左侧的垂直线。 static int INDICATOR_OVAL 指示选择指示器是选项卡上的椭圆形背景。 从类 ohos.agp.components.Component 继承的字段 ACCESSIBILITY_ADAPTABLE, ACCESSIBILITY_DISABLE, ACCESSIBILITY_ENABLE, AXIS_X, AXIS_Y, CONTOUR_BACKGROUND, CONTOUR_BORDER, CONTOUR_PADDING_BORDER, DEFAULT_SCALE, DRAG_DOWN, DRAG_HORIZONTAL, DRAG_HORIZONTAL_VERTICAL, DRAG_LEFT, DRAG_RIGHT, DRAG_UP, DRAG_VERTICAL, EVENT_TYPE_COMPONENT_ACCESSIBILITY_FOCUSED, EVENT_TYPE_COMPONENT_ACCESSIBILITY_FOCUSED_CLEAR, EVENT_TYPE_COMPONENT_CLICKED, EVENT_TYPE_COMPONENT_FOCUSED, EVENT_TYPE_COMPONENT_LONG_CLICKED, EVENT_TYPE_COMPONENT_SCROLLED, EVENT_TYPE_COMPONENT_SELECTED, EVENT_TYPE_COMPONENT_TEXT_UPDATE, EVENT_TYPE_NOTICE, EVENT_TYPE_NOTIFICATION_STATE_UPDATE, EVENT_TYPE_TOAST_SHOW, EVENT_TYPE_WINDOW_STATE_UPDATE, FOCUS_ADAPTABLE, FOCUS_DISABLE, FOCUS_ENABLE, FOCUS_NEXT, FOCUS_PREVIOUS, FOCUS_SIDE_BOTTOM, FOCUS_SIDE_LEFT, FOCUS_SIDE_RIGHT, FOCUS_SIDE_TOP, HIDE, HORIZONTAL, ID_DEFAULT, INHERITED_MODE, INVISIBLE, mBackgroundElement, mCanvasForTaskOverContent, mCanvasForTaskUnderContent, mComponentParent, mContext, mDrawTaskOverContent, mDrawTaskUnderContent, mEstimateSizeListener, mForegroundElement, mForwardHoverListener, mHoverEventListener, mKeyEventListener, mMouseEventListener, mPosition, mRotationEventListener, mShadowElement, mUnconsumedKeyEventListener, OVAL_MODE, OVAL_SCROLL_BAR_MODE, POSITION_X_INDEX, POSITION_Y_INDEX, RECT_MODE, RECT_SCROLL_BAR_MODE, SCROLL_AUTO_STAGE, SCROLL_IDLE_STAGE, SCROLL_NORMAL_STAGE, UNSPECIFIED_SCROLL_BAR_MODE, VERTICAL, VISIBLE 从类 ohos.agp.components.ComponentContainer 继承的字段 FOCUS_CHILDREN_FIRST, FOCUS_CHILDREN_HIDE, FOCUS_PARENT_FIRST, mArrangeListener 从类 ohos.agp.components.ScrollView 继承的字段 ROTATION_SENSITIVITY_DEFAULT, ROTATION_SENSITIVITY_HIGH, ROTATION_SENSITIVITY_LOW 构造函数摘要 构造函数 描述 TabList(Context context) 默认构造函数用于使用默认属性集和样式创建 TabList 实例。 TabList(Context context, AttrSet attrSet) 用于在 XML 文件解析后使用指定的属性集和默认样式创建 TabList 实例的构造函数。 TabList(Context context, AttrSet attrSet, String styleName) 用于在 XML 文件解析后使用指定的属性集和指定的样式创建 TabList 实例的构造函数。 方法总结 修饰符和类型 方法 描述 void addTab(TabList.Tab tab) 在当前布局的末尾添加一个选项卡。 void addTab(TabList.Tab tab, boolean selected) 在当前布局的末尾添加一个选项卡并指定它是否被选中。 void addTab(TabList.Tab tab, int pos) 将选项卡添加到当前布局中的指定位置。 void addTab(TabList.Tab tab, int pos, boolean selected) 将选项卡添加到当前布局中的某个位置并指定它是否被选中。 void addTabSelectedListener(TabList.TabSelectedListener listener) 将选定的侦听器添加到列表中的选项卡。 int getIndicatorType() 获取选项卡指示器类型。 int getNormalTabTextColor() 获取该选项卡处于正常状态时的文本颜色。 int getOrientation() 获取布局方向。 TabList.Tab getSelectedTab() 获取组件中选定的选项卡。 int...

鸿蒙OS TableLayoutManager

TableLayoutManager java.lang.Object |—ohos.agp.components.LayoutManager |—|—ohos.agp.components.TableLayoutManager public class TableLayoutManager extends LayoutManager 表示 ListContainer 对象的表布局管理器。 Since: 5 构造函数摘要 构造函数 描述 TableLayoutManager() 用于创建 TableLayoutManager 实例的默认构造函数。 方法总结 修饰符和类型 方法 描述 int getColumnCount() 获取表中的列数。 int getRowCount() 获取表中的行数。 void setColumnCount(int columnCount) 设置表中的列数。 void setRowCount(int rowCount) 设置表中的行数。 从类 ohos.agp.components.LayoutManager 继承的方法 getOrientation, setOrientation 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 构造函数详细信息 TableLayoutManager public TableLayoutManager() 用于创建 TableLayoutManager 实例的默认构造函数。 Since: 5 方法详情 setColumnCount public void setColumnCount(int columnCount) 设置表中的列数。 参数: 参数名称 参数描述 columnCount 表示列数。 Since: 5 getColumnCount public int getColumnCount() 获取表中的列数。 返回: 返回列数。 Since: 5 setRowCount public void setRowCount(int rowCount) 设置表中的行数。 参数: 参数名称 参数描述 rowCount 表示行数。 Since: 5 getRowCount public int getRowCount() 获取表中的行数。 返回: 返回行数。 Since: 5

鸿蒙OS TableLayout.Specification

TableLayout.Specification java.lang.Object |—ohos.agp.components.TableLayout.Specification public static class TableLayout.Specification extends Object 配置表格布局中元素的列和行属性。 表格布局中的元素必须具有特定的单元格跨度、起始单元格、对齐方式或权重来确定其布局效果。 Since: 3 字段摘要 修饰符和类型 字段 描述 int alignment 定义行的垂直对齐或列的水平对齐。 TableLayout.CellSpan span 定义表格布局中元素的起始单元格和单元格范围。 boolean startDefined 指示是否为表格布局中组件的起始单元格设置索引。 float weight 表示表格布局中元素的权重。 方法总结 修饰符和类型 方法 描述 int getMaxSpan() 获取表格布局中元素的结束单元格。 int getMinSpan() 获取表格布局中元素的起始单元格。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 字段详细信息 alignment public final int alignment 定义行的垂直对齐或列的水平对齐。 span public final TableLayout.CellSpan span 定义表格布局中元素的起始单元格和单元格范围。 startDefined public final boolean startDefined 指示是否为表格布局中组件的起始单元格设置索引。 True 值表示为表格布局中组件的起始单元格设置了索引; 值 False 表示没有为表格布局中组件的起始单元格设置索引。 Since: 1 weight public final float weight 表示表格布局中元素的权重。 方法详情 getMinSpan public int getMinSpan() 获取表格布局中元素的起始单元格。 返回: 返回表格布局中元素的起始单元格。 getMaxSpan public int getMaxSpan() 获取表格布局中元素的结束单元格。 返回: 返回表格布局中元素的结束单元格。

鸿蒙OS TableLayout.LayoutConfig

TableLayout.LayoutConfig java.lang.Object |—ohos.agp.components.ComponentContainer.LayoutConfig |—|—ohos.agp.components.TableLayout.LayoutConfig public static class TableLayout.LayoutConfig extends ComponentContainer.LayoutConfig 提供表格布局所需的布局配置。 表格布局配置集成了 ComponentContainer.LayoutConfig 并提供了 TableLayout.Specification。 前者表示组件容器中的边距布局配置,后者表示行和列规范。 Since: 3 字段摘要 修饰符和类型 字段 描述 TableLayout.Specification columnSpec 指示表格布局中的列规范。 TableLayout.Specification rowSpec 指示表格布局中的行规范。 从类 ohos.agp.components.ComponentContainer.LayoutConfig 继承的字段 height, MATCH_CONTENT, MATCH_PARENT, width 构造函数摘要 构造函数 描述 LayoutConfig() 用于创建 LayoutConfig 实例的默认构造函数。 LayoutConfig(int width, int height) 用于指定表格布局的宽度和高度的构造函数。 LayoutConfig(ComponentContainer.LayoutConfig params) 用于复制 ComponentContainer.LayoutConfig 实例的构造函数。 LayoutConfig(TableLayout.LayoutConfig source) 用于复制 LayoutConfig 实例的行和列规范的构造函数。 LayoutConfig(TableLayout.Specification rowSpec, TableLayout.Specification columnSpec) 用于在表格布局中创建行和列规范的构造函数。 LayoutConfig(Context context, AttrSet attrSet) 用于根据上下文和属性集创建 LayoutConfig 实例的构造函数。 方法总结 从类 ohos.agp.components.ComponentContainer.LayoutConfig 继承的方法 clone, getHorizontalEndMargin, getHorizontalStartMargin, getLayoutDirection, getMarginBottom, getMarginLeft, getMarginRight, getMargins, getMarginsLeftAndRight, getMarginsTopAndBottom, getMarginTop, isMarginsRelative, setMarginBottom, setMarginLeft, setMarginRight, setMargins, setMarginsLeftAndRight, setMarginsRelative, setMarginsTopAndBottom, setMarginTop 从类 java.lang.Object 继承的方法 equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 字段详细信息 columnSpec public TableLayout.Specification columnSpec 指示表格布局中的列规范。 Since: 1 rowSpec public TableLayout.Specification rowSpec 指示表格布局中的行规范。 Since: 1 构造函数详细信息 LayoutConfig public LayoutConfig() 用于创建 LayoutConfig 实例的默认构造函数。 Since: 3 LayoutConfig public LayoutConfig(Context context, AttrSet attrSet) 用于根据上下文和属性集创建 LayoutConfig 实例的构造函数。 参数: 参数名称 参数描述 context 指示应用程序上下文。 attrSet 指示要使用的属性集。 Since: 3 LayoutConfig public LayoutConfig(TableLayout.Specification rowSpec, TableLayout.Specification columnSpec) 用于在表格布局中创建行和列规范的构造函数。 参数: 参数名称 参数描述 rowSpec 指示表格布局中的行规范。 columnSpec 指示表格布局中的列规范。 Since: 3 LayoutConfig public LayoutConfig(int width, int height)...

鸿蒙OS TableLayout.CellSpan

TableLayout.CellSpan java.lang.Object |—ohos.agp.components.TableLayout.CellSpan public static final class TableLayout.CellSpan extends Object 在表格布局中存储元素的跨度、起始单元格和结束单元格。 表格布局中元素的跨度是从其起始单元格到其结束单元格计算的。 Since: 1 字段摘要 修饰符和类型 字段 描述 int max 指示表格布局中元素的结束单元格。 int min 指示表格布局中元素的起始单元格。 构造函数摘要 构造函数 描述 CellSpan(int min, int max) 用于为表格布局中的元素创建 CellSpan 实例的构造函数。 方法总结 修饰符和类型 方法 描述 protected int size() 获取表格布局中元素的单元格跨度。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 字段详细信息 max public final int max 指示表格布局中元素的结束单元格。 min public final int min 指示表格布局中元素的起始单元格。 构造函数详细信息 CellSpan public CellSpan(int min, int max) 用于为表格布局中的元素创建 CellSpan 实例的构造函数。 参数: 参数名称 参数描述 min 表示元素的起始单元格,不能小于0。 max 表示元素的结束单元格,不能小于 0。 方法详情 size protected int size() 获取表格布局中元素的单元格跨度。 元素的单元格跨度是从其起始单元格到其结束单元格计算的。 返回: 返回表格布局中元素的单元格跨度。

鸿蒙OS TableLayout

TableLayout java.lang.Object |—ohos.agp.components.Component |—|—ohos.agp.components.ComponentContainer |—|—|—ohos.agp.components.TableLayout public class TableLayout extends ComponentContainer 提供用于在带有表格的组件中排列组件的布局。 TableLayout 提供了对组件进行对齐和排列的接口,以用表格显示组件中的组件。 可配置排列方式、行列数、元件位置。 Since: 3 嵌套类摘要 修饰符和类型 类 描述 static interface TableLayout.Alignment 为表格布局中的子组件提供对齐模式。 static class TableLayout.CellSpan 在表格布局中存储元素的跨度、起始单元格和结束单元格。 static class TableLayout.LayoutConfig 提供表格布局所需的布局配置。 static class TableLayout.Specification 配置表格布局中元素的列和行属性。 从类 ohos.agp.components.Component 继承的嵌套类/接口 Component.BindStateChangedListener, Component.CanAcceptScrollListener, Component.ClickedListener, Component.ComponentStateChangedListener, Component.ContourRefreshedListener, Component.DefSpeechEventListener, Component.DoubleClickedListener, Component.DragFeedbackProvider, Component.DraggedListener, Component.DrawTask, Component.EditEventListener, Component.EstimateSizeListener, Component.EstimateSpec, Component.FadeEffectEnum, Component.FocusChangedListener, Component.ForwardHoverListener, Component.ForwardTouchListener, Component.GestureType, Component.HoverEventListener, Component.KeyEventListener, Component.LayoutDirection, Component.LayoutRefreshedListener, Component.LongClickedListener, Component.MeasureSpec, Component.MouseEventListener, Component.MousePointerStyleListener, Component.OnDragListener, Component.RotationEventListener, Component.ScaledListener, Component.ScrolledListener, Component.ShadowDevice, Component.ShadowMode, Component.ShadowSize, Component.SpeechEventListener, Component.TouchEventListener, Component.UnconsumedKeyEventListener, Component.VoiceEvent 从类 ohos.agp.components.ComponentContainer 继承的嵌套类/接口 ComponentContainer.ArrangeListener 字段摘要 修饰符和类型 字段 描述 static int ALIGN_CONTENTS 指示子组件的边距对齐方式。 static int ALIGN_EDGES 指示子组件的边界对齐方式。 static int DEFAULT 表示未定义的表格布局参数。 从类 ohos.agp.components.Component 继承的字段 ACCESSIBILITY_ADAPTABLE, ACCESSIBILITY_DISABLE, ACCESSIBILITY_ENABLE, AXIS_X, AXIS_Y, CONTOUR_BACKGROUND, CONTOUR_BORDER, CONTOUR_PADDING_BORDER, DEFAULT_SCALE, DRAG_DOWN, DRAG_HORIZONTAL, DRAG_HORIZONTAL_VERTICAL, DRAG_LEFT, DRAG_RIGHT, DRAG_UP, DRAG_VERTICAL, EVENT_TYPE_COMPONENT_ACCESSIBILITY_FOCUSED, EVENT_TYPE_COMPONENT_ACCESSIBILITY_FOCUSED_CLEAR, EVENT_TYPE_COMPONENT_CLICKED, EVENT_TYPE_COMPONENT_FOCUSED, EVENT_TYPE_COMPONENT_LONG_CLICKED, EVENT_TYPE_COMPONENT_SCROLLED, EVENT_TYPE_COMPONENT_SELECTED, EVENT_TYPE_COMPONENT_TEXT_UPDATE, EVENT_TYPE_NOTICE, EVENT_TYPE_NOTIFICATION_STATE_UPDATE, EVENT_TYPE_TOAST_SHOW, EVENT_TYPE_WINDOW_STATE_UPDATE, FOCUS_ADAPTABLE, FOCUS_DISABLE, FOCUS_ENABLE, FOCUS_NEXT, FOCUS_PREVIOUS, FOCUS_SIDE_BOTTOM, FOCUS_SIDE_LEFT, FOCUS_SIDE_RIGHT, FOCUS_SIDE_TOP, HIDE, HORIZONTAL, ID_DEFAULT, INHERITED_MODE, INVISIBLE, mBackgroundElement, mCanvasForTaskOverContent, mCanvasForTaskUnderContent, mComponentParent, mContext, mDrawTaskOverContent, mDrawTaskUnderContent, mEstimateSizeListener, mForegroundElement, mForwardHoverListener, mHoverEventListener, mKeyEventListener, mMouseEventListener, mPosition, mRotationEventListener, mShadowElement, mUnconsumedKeyEventListener, OVAL_MODE, OVAL_SCROLL_BAR_MODE, POSITION_X_INDEX, POSITION_Y_INDEX, RECT_MODE, RECT_SCROLL_BAR_MODE, SCROLL_AUTO_STAGE, SCROLL_IDLE_STAGE, SCROLL_NORMAL_STAGE, UNSPECIFIED_SCROLL_BAR_MODE, VERTICAL, VISIBLE 从类 ohos.agp.components.ComponentContainer 继承的字段 FOCUS_CHILDREN_FIRST, FOCUS_CHILDREN_HIDE, FOCUS_PARENT_FIRST, mArrangeListener 构造函数摘要 构造函数 描述 TableLayout(Context context) 用于使用默认属性集和样式创建 TableLayout 实例的默认构造函数。 TableLayout(Context context, AttrSet attrSet) 用于在 XML 文件解析后使用指定的属性集和默认样式创建 TableLayout 实例的构造函数。 TableLayout(Context context, AttrSet attrSet, String styleName) 用于在 XML 文件解析后使用指定的属性集和指定的样式创建 TableLayout 实例的构造函数。 方法总结 修饰符和类型 方法 描述 ComponentContainer.LayoutConfig createLayoutConfig(Context context, AttrSet attrSet) 使用子组件的属性集创建布局参数。 int getAlignmentType() 获取表格布局中的对齐方式。 int getColumnCount() 获取表格布局中的列数。 int getOrientation() 获取表格布局的布局方向。 int getRowCount() 获取表格布局中的行数。 void setAlignmentType(int type) 设置表格布局中的对齐模式。 void setColumnCount(int columnCount) 设置表格布局中的列数。 void setOrientation(int orientation) 设置表格布局方向。 void setRowCount(int rowCount) 设置表格布局中的行数。 static TableLayout.Specification specification(float weight) 根据元素的权重返回规范实例。 static TableLayout.Specification specification(int start) 根据表格布局中元素的起始位置返回规范实例。 static TableLayout.Specification specification(int start, float weight) 根据表格布局中元素的起始位置和元素权重返回规范实例。 static TableLayout.Specification specification(int start, int size) 根据表格布局中元素的起始位置和元素大小返回规范实例。 static TableLayout.Specification specification(int start, int size, float weight) 根据表格布局中元素的起始位置以及元素大小和重量返回规范实例。 static TableLayout.Specification specification(int start, int size, int alignment) 根据元素在表格布局中的起始位置以及元素大小和对齐方式获取规范实例。 static TableLayout.Specification...

鸿蒙OS Switch

Switch java.lang.Object |—ohos.agp.components.Component |—|—ohos.agp.components.Text |—|—|—ohos.agp.components.Button |—|—|—|—ohos.agp.components.AbsButton |—|—|—|—|—ohos.agp.components.Switch public class Switch extends AbsButton 提供可以启用或禁用的开关。 Since: 1 嵌套类摘要 从类 ohos.agp.components.AbsButton 继承的嵌套类/接口 AbsButton.CheckedStateChangedListener 从类 ohos.agp.components.Component 继承的嵌套类/接口 Component.BindStateChangedListener, Component.CanAcceptScrollListener, Component.ClickedListener, Component.ComponentStateChangedListener, Component.ContourRefreshedListener, Component.DefSpeechEventListener, Component.DoubleClickedListener, Component.DragFeedbackProvider, Component.DraggedListener, Component.DrawTask, Component.EditEventListener, Component.EstimateSizeListener, Component.EstimateSpec, Component.FadeEffectEnum, Component.FocusChangedListener, Component.ForwardHoverListener, Component.ForwardTouchListener, Component.GestureType, Component.HoverEventListener, Component.KeyEventListener, Component.LayoutDirection, Component.LayoutRefreshedListener, Component.LongClickedListener, Component.MeasureSpec, Component.MouseEventListener, Component.MousePointerStyleListener, Component.OnDragListener, Component.RotationEventListener, Component.ScaledListener, Component.ScrolledListener, Component.ShadowDevice, Component.ShadowMode, Component.ShadowSize, Component.SpeechEventListener, Component.TouchEventListener, Component.UnconsumedKeyEventListener, Component.VoiceEvent 从类 ohos.agp.components.Text 继承的嵌套类/接口 Text.ConversionType, Text.EditorActionListener, Text.FontFamilyType, Text.TextColorObserver, Text.TextObserver, Text.TextSizeObserver, Text.TextSizeType, Text.TruncationMode 字段摘要 从类 ohos.agp.components.Component 继承的字段 ACCESSIBILITY_ADAPTABLE, ACCESSIBILITY_DISABLE, ACCESSIBILITY_ENABLE, AXIS_X, AXIS_Y, CONTOUR_BACKGROUND, CONTOUR_BORDER, CONTOUR_PADDING_BORDER, DEFAULT_SCALE, DRAG_DOWN, DRAG_HORIZONTAL, DRAG_HORIZONTAL_VERTICAL, DRAG_LEFT, DRAG_RIGHT, DRAG_UP, DRAG_VERTICAL, EVENT_TYPE_COMPONENT_ACCESSIBILITY_FOCUSED, EVENT_TYPE_COMPONENT_ACCESSIBILITY_FOCUSED_CLEAR, EVENT_TYPE_COMPONENT_CLICKED, EVENT_TYPE_COMPONENT_FOCUSED, EVENT_TYPE_COMPONENT_LONG_CLICKED, EVENT_TYPE_COMPONENT_SCROLLED, EVENT_TYPE_COMPONENT_SELECTED, EVENT_TYPE_COMPONENT_TEXT_UPDATE, EVENT_TYPE_NOTICE, EVENT_TYPE_NOTIFICATION_STATE_UPDATE, EVENT_TYPE_TOAST_SHOW, EVENT_TYPE_WINDOW_STATE_UPDATE, FOCUS_ADAPTABLE, FOCUS_DISABLE, FOCUS_ENABLE, FOCUS_NEXT, FOCUS_PREVIOUS, FOCUS_SIDE_BOTTOM, FOCUS_SIDE_LEFT, FOCUS_SIDE_RIGHT, FOCUS_SIDE_TOP, HIDE, HORIZONTAL, ID_DEFAULT, INHERITED_MODE, INVISIBLE, mBackgroundElement, mCanvasForTaskOverContent, mCanvasForTaskUnderContent, mComponentParent, mContext, mDrawTaskOverContent, mDrawTaskUnderContent, mEstimateSizeListener, mForegroundElement, mForwardHoverListener, mHoverEventListener, mKeyEventListener, mMouseEventListener, mPosition, mRotationEventListener, mShadowElement, mUnconsumedKeyEventListener, OVAL_MODE, OVAL_SCROLL_BAR_MODE, POSITION_X_INDEX, POSITION_Y_INDEX, RECT_MODE, RECT_SCROLL_BAR_MODE, SCROLL_AUTO_STAGE, SCROLL_IDLE_STAGE, SCROLL_NORMAL_STAGE, UNSPECIFIED_SCROLL_BAR_MODE, VERTICAL, VISIBLE 从类 ohos.agp.components.Text 继承的字段 AUTO_CURSOR_POSITION, AUTO_SCROLLING_FOREVER 构造函数摘要 构造函数 描述 Switch(Context context) 默认构造函数用于使用默认属性集和样式创建 Switch 实例。 Switch(Context context, AttrSet attrSet) 用于在 XML 文件解析后使用指定的属性集和默认样式创建 Switch 实例的构造函数。 Switch(Context context, AttrSet attrSet, String styleName) 一个构造函数,用于在解析 XML 文件后使用指定的属性集和指定的样式创建 Switch 实例。 方法总结 修饰符和类型 方法 描述 String getStateOffText() 获取处于禁用状态的开关的显示文本。 String getStateOnText() 获取启用状态的开关的显示文本。 Element getThumbElement() 获取开关拇指的元素。 int getThumbHeight() 获取开关中拇指的高度。 int getThumbHorizontalPadding() 获取开关的水平填充。 int[] getThumbPadding() 获取开关拇指上文本的水平和垂直填充。 int[] getThumbSize() 获取开关拇指的高度和宽度。 int getThumbVerticalPadding() 获取开关的垂直填充。 int getThumbWidth() 获取开关中拇指的宽度。 Element getTrackElement() 获取切换轨道的元素。 void setStateOffText(String text) 将开关的显示文本设置为禁用状态。 void setStateOnText(String text) 将开关的显示文本设置为启用状态。 void setThumbElement(Element element) 设置一个元素来设置开关拇指的样式。 void setThumbHeight(int height) 设置开关拇指的高度。 void setThumbHorizontalPadding(int horizontalPadding) 设置开关拇指上文本的水平填充。 void setThumbPadding(int horizontalPadding, int verticalPadding) 设置开关拇指的填充。 void setThumbSize(int width, int height) 设置开关拇指的大小,高度和宽度应小于轨道 void setThumbVerticalPadding(int verticalPadding) 为开关拇指上的文本设置垂直填充。 void setThumbWidth(int width) 设置开关拇指的宽度。 void setTrackElement(Element element) 设置一个元素来设置开关轨道的样式。 从类 ohos.agp.components.AbsButton 继承的方法 getButtonElement, getTextColorOff, getTextColorOn, isChecked, setButtonElement, setChecked, setCheckedStateChangedListener, setTextColorOff, setTextColorOn, toggle 从类 ohos.agp.components.Component 继承的方法 addDrawTask, addDrawTask, addScrolledListener, announceAccessibility, arrange, bindCornerMark, callOnClick, canScroll, clearFocus, createAnimatorProperty, disableFadeEffect, dispatchRestoreState, dispatchSaveState, draw, enableCornerMark, enableFadeEffect, enableSaveState, enableScrollBar, estimateSize, executeDoubleClick, executeLongClick, findComponentById, findComponentHolderById, findFocus, findNextFocusableComponent, findRequestNextFocus, getAccessibility, getAccessibilityDescription, getAlpha, getAltitude, getBackgroundElement, getBaseLine, getBottom, getBoundaryFadeEffectBottomRate, getBoundaryFadeEffectLeftRate, getBoundaryFadeEffectRightRate, getBoundaryFadeEffectTopRate, getCenterZoomFactor, getCentralScrollMode, getClickedListener, getClipEnabled, getComponentDescription, getComponentMinSize, getComponentParent, getComponentPosition, getComponentSize, getComponentStateChangedListener, getComponentTreeObserver, getContentEnable, getContentPosition, getContentPositionX, getContentPositionY, getContext, getContour, getContourRefreshedListener, getCornerMark, getDragAcceptAngle, getDraggedListener, getEditEventListener, getEstimatedHeight, getEstimatedWidth, getFadeEffectColor, getFocusable, getFocusBorderEnable, getFocusBorderPadding, getFocusBorderRadius, getFocusBorderWidth, getForegroundElement, getForegroundGravity, getForwardHoverListener, getForwardTouchListener, getGesturePriority, getHeight, getHorizontalPadding, getHorizontalPosition, getHoverEventListener, getId, getKeyEventListener, getLayoutConfig, getLayoutDirection, getLayoutDirectionResolved, getLayoutRefreshedListener, getLeft, getLocationOnScreen, getMarginBottom, getMarginLeft, getMarginRight, getMargins, getMarginsLeftAndRight, getMarginsTopAndBottom, getMarginTop, getMatrix, getMinHeight, getMinWidth, getMode, getModeResolved, getMouseEventListener, getMousePointerStyleListener, getName, getPadding, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getPivot, getPivotX, getPivotY, getResourceManager, getRight, getRotation, getRotationEventListener, getRotationSensitivity, getScale, getScaledListener, getScaleX, getScaleY, getScrollbarBackgroundColor, getScrollbarColor, getScrollbarFadingDelay, getScrollbarFadingDuration, getScrollBarMode, getScrollbarRadius, getScrollbarRoundRect, getScrollbarStartAngle, getScrollbarSweepAngle, getScrollbarThickness, getScrollState, getScrollValue, getSelfVisibleRect, getShadowColor, getSpeechEventListener, getTag, getTop, getTouchEventListener, getTransitionSymbol, getTranslation, getTranslationX, getTranslationY, getTranslationZ, getUserNextFocus, getVerticalPadding, getVerticalPosition, getVisibility, getVisibleRectOnScreen, getWidth, getWindowVisibleRect, hasFocus, hasFocusedEffect, hasOverlaps, hideFocusBorder, informConfigurationChanged, invalidate, isBoundaryFadeEffectEnable, isBoundToWindow, isClickable, isClipToContourEnabled, isComponentDisplayed, isEnabled, isFadeEffected, isFocusable, isFocused, isIdentityMatrix, isLongClickOn, isPressed, isRtl, isSaveStateEnabled, isScrollbarFadingOn, isScrollBarOn, isScrollbarOverlapEnabled, isSelected, isSoundEnable, isTouchFocusable, isVibrationEffectEnabled, notifyAccessibility, onAttributeConfigChanged, onDrag, onRestoreState, onSaveState, performScale, playSound, postLayout, refreshContour, release, removeBindStateChangedListener, removeScrolledListener, requestFocus, requestForceForwardTouchEvent, restoreComponentTreeState, saveComponentTreeState, scrollBy, scrollTo, setAccessibility, setAccessibilityDescription, setAlpha, setAltitude, setBackground, setBindStateChangedListener, setBottom, setBoundaryFadeEffectEnable, setCanAcceptScrollListener, setCenterZoomFactor, setCentralScrollMode, setClickable, setClickedListener, setClipEnabled, setClipToContourEnabled, setComponentDescription, setComponentMinSize, setComponentPosition, setComponentPosition, setComponentSize, setComponentStateChangedListener, setContentEnable, setContentPosition, setContentPositionX, setContentPositionY, setContour, setContourRefreshedListener, setDoubleClickedListener, setDragAcceptAngle, setDraggedListener, setEditEventListener, setEnabled, setEstimatedSize, setEstimateSizeListener, setFadeEffectColor, setFocusable, setFocusBorderEnable, setFocusBorderPadding, setFocusBorderRadius, setFocusBorderRadius, setFocusBorderWidth, setFocusChangedListener, setFocusedEffect, setForeground, setForegroundGravity, setForwardHoverListener, setForwardTouchListener, setGesturePriority, setHeight, setHorizontalPadding, setHorizontalPosition, setHoverEventListener, setId, setKeyEventListener, setLayoutConfig, setLayoutDirection, setLayoutRefreshedListener, setLeft, setLongClickable, setLongClickedListener, setMarginBottom, setMarginLeft, setMarginRight, setMarginsLeftAndRight, setMarginsTopAndBottom, setMarginTop, setMinHeight, setMinWidth, setMode, setMouseEventListener, setMousePointerStyleListener, setName, setOnDragListener, setPadding, setPaddingBottom, setPaddingLeft, setPaddingRelative, setPaddingRight, setPaddingTop, setPivot, setPivot, setPivotX, setPivotY, setPosition, setPositionX, setPositionY, setPressState, setRight, setRotation, setRotationEventListener, setRotationSensitivity, setScale, setScaledListener, setScaleX, setScaleY, setScrollbarBackgroundColor, setScrollbarColor, setScrollbarFadingDelay, setScrollbarFadingDuration, setScrollbarFadingEnabled, setScrollBarMode, setScrollbarOverlapEnabled, setScrollbarRadius, setScrollbarRoundRect, setScrollbarStartAngle, setScrollbarSweepAngle, setScrollbarThickness, setScrolledListener, setSelected, setShadowColor, setShadowStyle, setSoundEnable, setSpeechEventListener, setTag, setTop, setTouchEventListener, setTouchFocusable, setTransitionSymbol, setTranslation, setTranslationX, setTranslationY, setTranslationZ, setUnconsumedKeyEventListener, setUserNextFocus, setVerticalPadding, setVerticalPosition, setVibrationEffectEnabled, setVisibility, setWidth, showFocusBorder, simulateClick, simulateDrag, startDragAndDrop, subscribeVoiceEvents, unsubscribeVoiceEvents 从类 java.lang.Object...

鸿蒙OS StackLayout.LayoutConfig

StackLayout.LayoutConfig java.lang.Object |—ohos.agp.components.ComponentContainer.LayoutConfig |—|—ohos.agp.components.StackLayout.LayoutConfig public static class StackLayout.LayoutConfig extends ComponentContainer.LayoutConfig 配置 StackLayout 的布局参数,包括宽度、高度和页边距。 Since: 3 字段摘要 修饰符和类型 字段 描述 int alignment 指示控件的对齐值。 static int UNSPECIFIED_ALIGNMENT 表示尚未设置的对齐值。 从类 ohos.agp.components.ComponentContainer.LayoutConfig 继承的字段 height, MATCH_CONTENT, MATCH_PARENT, width 构造函数摘要 构造函数 描述 LayoutConfig() 默认构造函数,将默认宽度和高度设置为 MATCH_CONTENT。 LayoutConfig(int width, int height) 用于设置布局的宽度和高度参数的构造函数。 LayoutConfig(int width, int height, int alignment) 用于设置布局的宽度、高度和对齐参数的构造函数。 LayoutConfig(ComponentContainer.LayoutConfig source) 用于根据源布局的宽度、高度和边距设置布局参数的构造函数。 LayoutConfig(StackLayout.LayoutConfig source) 用于根据源布局的宽度、高度、边距和对齐方式设置布局参数的构造函数。 LayoutConfig(Context context, AttrSet attrSet) 用于根据上下文和属性集创建 LayoutConfig 实例的构造函数。 方法总结 从类 ohos.agp.components.ComponentContainer.LayoutConfig 继承的方法 clone, getHorizontalEndMargin, getHorizontalStartMargin, getLayoutDirection, getMarginBottom, getMarginLeft, getMarginRight, getMargins, getMarginsLeftAndRight, getMarginsTopAndBottom, getMarginTop, isMarginsRelative, setMarginBottom, setMarginLeft, setMarginRight, setMargins, setMarginsLeftAndRight, setMarginsRelative, setMarginsTopAndBottom, setMarginTop 从类 java.lang.Object 继承的方法 equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 字段详细信息 UNSPECIFIED_ALIGNMENT public static final int UNSPECIFIED_ALIGNMENT 表示尚未设置的对齐值。 alignment public int alignment 指示控件的对齐值。 构造函数详细信息 LayoutConfig public LayoutConfig() 默认构造函数,将默认宽度和高度设置为 MATCH_CONTENT。 Since: 3 LayoutConfig public LayoutConfig(Context context, AttrSet attrSet) 用于根据上下文和属性集创建 LayoutConfig 实例的构造函数。 参数: 参数名称 参数描述 context 指示应用程序上下文。 attrSet 指示要使用的属性集。 Since: 3 LayoutConfig public LayoutConfig(int width, int height) 用于设置布局的宽度和高度参数的构造函数。 参数: 参数名称 参数描述 width 指定宽度,可以是特定值,也可以是 ComponentContainer.LayoutConfig.MATCH_PARENT 或 ComponentContainer.LayoutConfig.MATCH_CONTENT。 height 指定高度,可以是特定值,也可以是 ComponentContainer.LayoutConfig.MATCH_PARENT 或 ComponentContainer.LayoutConfig.MATCH_CONTENT。 Since: 3 LayoutConfig public LayoutConfig(int width, int height, int alignment) 用于设置布局的宽度、高度和对齐参数的构造函数。 参数: 参数名称 参数描述...