优惠码 第32页

鸿蒙OS TextFilter.FilterResults

TextFilter.FilterResults java.lang.Object |—ohos.agp.components.TextFilter.FilterResults protected static class TextFilter.FilterResults extends Object 获取过滤结果。 Since: 2 字段摘要 修饰符和类型 字段 描述 Object results 表示过滤结果。 int size 表示过滤结果的个数。 构造函数摘要 构造函数 描述 FilterResults() 用于创建 FilterResults 对象的默认构造函数。 方法总结 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 字段详细信息 results public Object results 表示过滤结果。 Since: 2 size public int size 表示过滤结果的个数。 Since: 2 构造函数详细信息 FilterResults public FilterResults() 用于创建 FilterResults 对象的默认构造函数。 Since: 2

鸿蒙OS TextFilter

TextFilter java.lang.Object |—ohos.agp.components.TextFilter public abstract class TextFilter extends Object 提供文本过滤器。 此类允许您的应用程序根据输入字符串过滤数据。 Since: 2 嵌套类摘要 修饰符和类型 类 描述 protected static class TextFilter.FilterResults 获取过滤结果。 构造函数摘要 构造函数 描述 TextFilter() 方法总结 修饰符和类型 方法 描述 protected abstract TextFilter.FilterResults executeFiltering(CharSequence constraint) 在过滤操作期间内部调用的接口。 void filter(CharSequence constraint) 开始过滤操作。 protected abstract void publishFilterResults(CharSequence constraint, TextFilter.FilterResults results) 发布过滤结果。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 构造函数详细信息 TextFilter public TextFilter() 方法详情 executeFiltering protected abstract TextFilter.FilterResults executeFiltering(CharSequence constraint) 在过滤操作期间内部调用的接口。 参数: 参数名称 参数描述 constraint 表示用于过滤数据的输入字符串。 返回: 返回过滤结果。 Since: 4 publishFilterResults protected abstract void publishFilterResults(CharSequence constraint, TextFilter.FilterResults results) 发布过滤结果。 参数: 参数名称 参数描述 constraint 表示用于过滤数据的输入字符串。 results 表示过滤结果。 Since: 4 filter public void filter(CharSequence constraint) 开始过滤操作。 参数: 参数名称 参数描述 constraint 表示用于过滤数据的输入字符串。 Since: 2

鸿蒙OS TextField

TextField java.lang.Object |—ohos.agp.components.Component |—|—ohos.agp.components.Text |—|—|—ohos.agp.components.TextField public class TextField extends Text 提供一个文本框。 该类继承自Text,用于输入和修改文本。 Since: 3 嵌套类摘要 修饰符和类型 类 描述 protected static interface TextField.CursorChangedListener 提供可在光标位置更改时调用的回调。 从类 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 构造函数摘要 构造函数 描述 TextField(Context context) 用于使用默认属性集和样式创建 TextField 实例的默认构造函数。 TextField(Context context, AttrSet attrSet) 用于在 XML 文件解析后使用指定的属性集和默认样式创建 TextField 实例的构造函数。 TextField(Context context, AttrSet attrSet, String styleName) 用于在 XML 文件解析后使用指定的属性集和指定的样式创建 TextField 实例的构造函数。 方法总结 修饰符和类型 方法 描述 Element getBasement() 获取用作文本框下划线的元素对象。 void setBasement(Element element) 将元素对象设置为文本框的下划线。 protected void setCursorChangedListener() 设置默认光标回调 protected void setCursorChangedListener(TextField.CursorChangedListener listener) 设置光标回调 从类 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 构造函数详细信息 TextField public TextField(Context context) 用于使用默认属性集和样式创建 TextField 实例的默认构造函数。 参数: 参数名称 参数描述 context 指示应用程序上下文。 Since: 3 TextField public TextField(Context context, AttrSet attrSet) 用于在 XML 文件解析后使用指定的属性集和默认样式创建 TextField 实例的构造函数。 参数: 参数名称 参数描述 context 指示应用程序上下文。 attrSet 指示要使用的属性集。 Since: 3 TextField public TextField(Context context, AttrSet attrSet, String styleName) 用于在 XML...

鸿蒙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() 获取表格布局中元素的单元格跨度。 元素的单元格跨度是从其起始单元格到其结束单元格计算的。 返回: 返回表格布局中元素的单元格跨度。