鸿蒙OS开发文档 第26页

鸿蒙OS DragInfo

DragInfo java.lang.Object |—ohos.agp.components.DragInfo public class DragInfo extends Object 存储识别的拖动手势的数据。 此类存储特定于已识别的拖动手势的数据,并通过回调函数返回数据。 字段摘要 修饰符和类型 字段 描述 Point downPoint 表示手指触摸屏幕位置的坐标。 Point startPoint 指示手指开始拖动的位置的坐标。 Point updatePoint 指示手指拖动时更新位置的坐标。 double xOffset 表示水平偏移。 double xVelocity 表示水平拖动的速度,以像素/秒为单位。 double yOffset 表示垂直偏移。 double yVelocity 表示垂直拖动的速度,以像素/秒为单位。 构造函数摘要 构造函数 描述 DragInfo(Point downPoint, Point startPoint, Point updatePoint, double xOffset, double yOffset, double xVelocity, double yVelocity) 创建拖动手势的信息。 方法总结 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 字段详细信息 downPoint public final Point downPoint 表示手指触摸屏幕位置的坐标。 startPoint public final Point startPoint 指示手指开始拖动的位置的坐标。 一旦识别出拖动手势,则将手指按下的位置视为起点。 updatePoint public final Point updatePoint 指示手指拖动时更新位置的坐标。 一旦触发拖动事件,则将拖动过程中手指的当前位置视为更新位置。 xOffset public final double xOffset 表示水平偏移。 与之前的水平拖动相比,获得了水平偏移。 xVelocity public final double xVelocity 表示水平拖动的速度,以像素/秒为单位。 yOffset public final double yOffset 表示垂直偏移。 与之前的垂直拖动相比,得到垂直偏移量。 yVelocity public final double yVelocity 表示垂直拖动的速度,以像素/秒为单位。 构造函数详细信息 DragInfo public DragInfo(Point downPoint, Point startPoint, Point updatePoint, double xOffset, double yOffset, double xVelocity, double yVelocity) 创建拖动手势的信息。 参数: 参数名称 参数描述 downPoint 表示手指触摸屏幕位置的坐标。 startPoint 指示手指开始拖动的位置的坐标。 updatePoint 指示手指拖动时更新位置的坐标。 xOffset...

鸿蒙OS DragEvent

DragEvent java.lang.Object |—ohos.agp.components.DragEvent public class DragEvent extends Object 定义拖动事件的属性。 拖拽事件在拖放操作的不同时间产生,即用户按住一个对象,然后将其拖到另一个位置。 字段摘要 修饰符和类型 字段 描述 static int DRAG_BEGIN 指示拖放操作的开始。 static int DRAG_DROP 指示拖动事件已完成。 static int DRAG_FINISH 表示对象已被删除。 static int DRAG_IN 表示拖动点已进入放置目标区域。 static int DRAG_MOVE 指示在拖放操作期间正在移动对象。 static int DRAG_OUT 表示被拖动的对象已移出放置目标。 方法总结 修饰符和类型 方法 描述 int getAction() 获得 action。 MimeData getClipData() 已弃用。 此更改从 API 版本 5 开始生效。由 getMimeData() 替换 MimeData getMimeData() 获取拖动事件的 MimeData。 float getX() 获取拖动点的 X 坐标。 float getY() 获取拖动点的 Y 坐标。 boolean isBroadcast() 确定是否正在广播拖动事件。 static DragEvent obtain(int action, float x, float y, MimeData mimeData) 用于创建新 DragEvent 实例的构造函数。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 字段详细信息 DRAG_BEGIN public static final int DRAG_BEGIN 指示拖放操作的开始。 DRAG_DROP public static final int DRAG_DROP 指示拖动事件已完成。 DRAG_FINISH public static final int DRAG_FINISH 表示对象已被删除。 DRAG_IN public static final int DRAG_IN 表示拖动点已进入放置目标区域。 DRAG_MOVE public static final int DRAG_MOVE 指示在拖放操作期间正在移动对象。 DRAG_OUT public static final int DRAG_OUT 表示被拖动的对象已移出放置目标。 方法详情 obtain public static DragEvent obtain(int action, float x, float y, MimeData mimeData) 用于创建新 DragEvent 实例的构造函数。...

鸿蒙OS DirectionalLayoutManager

DirectionalLayoutManager java.lang.Object |—ohos.agp.components.LayoutManager |—|—ohos.agp.components.DirectionalLayoutManager public class DirectionalLayoutManager extends LayoutManager 管理水平或垂直排列的组件的布局。 构造函数摘要 构造函数 描述 DirectionalLayoutManager() 用于创建 DirectionalLayoutManager 实例的默认构造函数。 方法总结 从类 ohos.agp.components.LayoutManager 继承的方法 getOrientation, setOrientation 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 构造函数详细信息 DirectionalLayoutManager public DirectionalLayoutManager() 用于创建 DirectionalLayoutManager 实例的默认构造函数。

鸿蒙OS DirectionalLayout.LayoutConfig

DirectionalLayout.LayoutConfig java.lang.Object |—ohos.agp.components.ComponentContainer.LayoutConfig |—|—ohos.agp.components.DirectionalLayout.LayoutConfig public static class DirectionalLayout.LayoutConfig extends ComponentContainer.LayoutConfig 指定子控件的布局参数。 字段摘要 修饰符和类型 字段 描述 int alignment 表示子组件的对齐方式。 static int UNSPECIFIED_ALIGNMENT 表示尚未设置的对齐值。 static float UNSPECIFIED_WEIGHT 表示尚未设置的权重。 float weight 表示子组件的权重。 从类 ohos.agp.components.ComponentContainer.LayoutConfig 继承的字段 height, MATCH_CONTENT, MATCH_PARENT, width 构造函数摘要 构造函数 描述 LayoutConfig() 默认构造函数用于创建 LayoutConfig 实例,其宽度和高度默认设置为 ComponentContainer.LayoutConfig#MATCH_CONTENT。 LayoutConfig(int width, int height) 用于根据指定的宽度和高度创建 LayoutConfig 实例的构造函数。 LayoutConfig(int width, int height, int alignment, float weight) 用于根据指定的宽度、高度、对齐方式和权重创建 LayoutConfig 实例的构造函数。 LayoutConfig(ComponentContainer.LayoutConfig source) 用于根据源布局的宽度和高度设置布局参数的构造函数。 LayoutConfig(DirectionalLayout.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 表示尚未设置的对齐值。 UNSPECIFIED_WEIGHT public static final float UNSPECIFIED_WEIGHT 表示尚未设置的权重。 alignment public int alignment 表示子组件的对齐方式。 weight public float weight 表示子组件的权重。 构造函数详细信息 LayoutConfig public LayoutConfig() 默认构造函数用于创建 LayoutConfig 实例,其宽度和高度默认设置为 ComponentContainer.LayoutConfig#MATCH_CONTENT。 LayoutConfig public LayoutConfig(Context context, AttrSet attrSet) 用于根据上下文和属性集创建 LayoutConfig 实例的构造函数。 参数: 参数名称 参数描述 context 指示应用程序上下文。 attrSet 指示要使用的属性集。 LayoutConfig public LayoutConfig(int width, int height) 用于根据指定的宽度和高度创建 LayoutConfig 实例的构造函数。 参数: 参数名称 参数描述 width 指定宽度,可以是特定值,也可以是 ComponentContainer.LayoutConfig.MATCH_PARENT 或 ComponentContainer.LayoutConfig.MATCH_CONTENT。 height 指定高度,可以是特定值,也可以是 ComponentContainer.LayoutConfig.MATCH_PARENT 或 ComponentContainer.LayoutConfig.MATCH_CONTENT。...

鸿蒙OS DirectionalLayout

DirectionalLayout java.lang.Object |—ohos.agp.components.Component |—|—ohos.agp.components.ComponentContainer |—|—|—ohos.agp.components.DirectionalLayout public class DirectionalLayout extends ComponentContainer 一种方向布局,其中控件水平或垂直排列。 Component.HORIZONTAL 表示水平排列控件,Component.VERTICAL 表示垂直排列控件。 嵌套类摘要 修饰符和类型 类 描述 static class DirectionalLayout.LayoutConfig 指定子控件的布局参数。 从类 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.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 构造函数摘要 构造函数 描述 DirectionalLayout(Context context) 用于使用默认属性集和样式创建 DirectionalLayout 实例的默认构造函数。 DirectionalLayout(Context context, AttrSet attrSet) 用于在 XML 文件解析后使用指定的属性集和默认样式创建 DirectionalLayout 实例的构造函数。 DirectionalLayout(Context context, AttrSet attrSet, String styleName) 用于在 XML 文件解析后使用指定的属性集和指定的样式创建 DirectionalLayout 实例的构造函数。 方法总结 修饰符和类型 方法 描述 ComponentContainer.LayoutConfig createLayoutConfig(Context context, AttrSet attrSet) 使用子组件的属性集创建布局参数。 int getAlignment() 获取子组件对齐方式。 int getOrientation() 获取控件在方向布局中的排列方向。 float getTotalWeight() 获取所有子控件的总权重。 boolean isLayoutBaselined() 检查布局中的组件是否在其基线上对齐。 void setAlignment(int alignment) 在容器的可用空间(如果有)中设置子组件对齐方式。 void setLayoutBaselined(boolean baselined) 定义布局中的视图是否在其基线上对齐。 void setOrientation(int orientation) 指定控件在方向布局中的排列方向。 void setTotalWeight(float totalWeight) 配置所有子控件的总权重。 ComponentContainer.LayoutConfig verifyLayoutConfig(ComponentContainer.LayoutConfig config) 根据当前布局类型验证布局参数。 从类 ohos.agp.components.Component 继承的方法 addDrawTask, addDrawTask, addScrolledListener, announceAccessibility, arrange, bindCornerMark, callOnClick, canScroll, clearFocus, createAnimatorProperty, disableFadeEffect, draw, enableCornerMark, enableFadeEffect, enableSaveState, enableScrollBar, estimateSize, executeDoubleClick, executeLongClick, 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, getFadeEffectBoundaryWidth, 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, invalidate, isBoundaryFadeEffectEnable, isBoundToWindow, isClickable, isClipToContourEnabled, isComponentDisplayed, isEnabled, isFadeEffected, isFocusable, isFocused, isIdentityMatrix, isLongClickOn, isPressed, isRtl, isSaveStateEnabled, isScrollbarFadingOn, isScrollBarOn, isScrollbarOverlapEnabled, isSelected, isSoundEnable, isTouchFocusable, isVibrationEffectEnabled, notifyAccessibility, onAttributeConfigChanged, onRestoreState, onRtlChanged, 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, setFadeEffectBoundaryWidth, 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 从类 ohos.agp.components.ComponentContainer 继承的方法 addComponent, addComponent, addComponent, addComponent, addComponent, dispatchRestoreState, dispatchSaveState, findComponentById, findComponentHolderById, getAutoLayout, getChildCount, getChildIndex, getComponentAt, getComponentTransition, getFocusOrder, getLayoutManager, informConfigurationChanged, isClipToChildBoundsEnabled, isClipToPaddingBoundsEnabled, isTouchEventSplitable, moveChildToFront, onDrag, removeAllComponents, removeComponent, removeComponentAt, removeComponentById, removeComponents, setArrangeListener, setAutoLayout, setAutoLayout, setClipToChildBoundsEnabled, setClipToPaddingBoundsEnabled, setComponentTransition, setFocusOrder, setLayoutManager, setTouchEventSplitable 从接口 ohos.agp.components.ComponentParent 继承的方法 getComponentParent, postLayout 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 构造函数详细信息 DirectionalLayout public DirectionalLayout(Context context) 用于使用默认属性集和样式创建 DirectionalLayout 实例的默认构造函数。 参数: 参数名称 参数描述 context 指示应用程序上下文。 DirectionalLayout public DirectionalLayout(Context context, AttrSet attrSet) 用于在 XML 文件解析后使用指定的属性集和默认样式创建 DirectionalLayout...

鸿蒙OS DependentLayout.LayoutConfig

DependentLayout.LayoutConfig java.lang.Object |—ohos.agp.components.ComponentContainer.LayoutConfig |—|—ohos.agp.components.DependentLayout.LayoutConfig public static class DependentLayout.LayoutConfig extends ComponentContainer.LayoutConfig 为依赖布局提供布局配置。 这些配置指定组件在 DependentLayout 中的位置。 如果组件不在 DependentLayout 中,则忽略这些布局配置。 字段摘要 修饰符和类型 字段 描述 static int ABOVE 表示一个子组件被放置在另一个子组件之上。 static int ALIGN_BASELINE 表示一个子组件的基线依赖于另一个子组件的。 static int ALIGN_BOTTOM 表示两个子组件是底部对齐的。 static int ALIGN_END 表示两个子组件末端对齐。 static int ALIGN_LEFT 表示两个子组件是左对齐的。 static int ALIGN_PARENT_BOTTOM 表示子组件和它的父组件是底部对齐的。 static int ALIGN_PARENT_END 表示子组件和它的父组件是端对齐的。 static int ALIGN_PARENT_LEFT 表示子组件和它的父组件是左对齐的。 static int ALIGN_PARENT_RIGHT 表示子组件和它的父组件是右对齐的。 static int ALIGN_PARENT_START 表示子组件和它的父组件是起始对齐的。 static int ALIGN_PARENT_TOP 表示子组件和它的父组件是顶部对齐的。 static int ALIGN_RIGHT 表示两个子组件是右对齐的。 static int ALIGN_START 表示两个子组件开始对齐。 static int ALIGN_TOP 表示两个子组件是顶部对齐的。 static int BELOW 表示一个子组件被放置在另一个子组件之下。 static int CENTER_IN_PARENT 表示子组件在其父组件中居中。 static int END_OF 表示将一个子组件放置在另一个子组件的末尾。 static int HORIZONTAL_CENTER 表示子组件在其父组件中水平居中。 static int LEFT_OF 表示将一个子组件放置在另一个子组件的左侧。 static int RIGHT_OF 表示将一个子组件放置在另一个子组件的右侧。 static int START_OF 表示将一个子组件放置在另一个子组件的开头。 static int TRUE 表示启用对齐模式。 static int VERTICAL_CENTER 表示子组件在其父组件中垂直居中。 从类 ohos.agp.components.ComponentContainer.LayoutConfig 继承的字段 height, MATCH_CONTENT, MATCH_PARENT, width 构造函数摘要 构造函数 描述 LayoutConfig() 用于创建 LayoutConfig 实例的默认构造函数。 LayoutConfig(int width, int height) 用于根据输入配置宽度和高度创建 LayoutConfig 实例的构造函数。 LayoutConfig(ComponentContainer.LayoutConfig source) 用于根据源布局的宽度、高度和边距设置布局参数的构造函数。 LayoutConfig(DependentLayout.LayoutConfig source) 用于根据源布局的宽度、高度、边距和布局规则创建 LayoutConfig 实例的构造函数。 LayoutConfig(Context context, AttrSet attrSet) 用于根据上下文和属性集创建 LayoutConfig 实例的构造函数。 方法总结 修饰符和类型 方法 描述 void addRule(int verb) 添加一个可以由 DependentLayout 解释的布局规则。 void addRule(int verb, int subject) 添加一个可以由 DependentLayout 解释的布局规则。 Object clone() 创建 DependentLayout.LayoutConfig 克隆。...

鸿蒙OS DependentLayout

DependentLayout java.lang.Object |—ohos.agp.components.Component |—|—ohos.agp.components.ComponentContainer |—|—|—ohos.agp.components.DependentLayout public class DependentLayout extends ComponentContainer 描述依赖布局。 一个依赖布局可以包含多个子组件,这些子组件指定它们的位置依赖于布局中的其他组件。 嵌套类摘要 修饰符和类型 类 描述 static class DependentLayout.LayoutConfig 为依赖布局提供布局配置。 从类 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.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 构造函数摘要 构造函数 描述 DependentLayout(Context context) 默认构造函数用于使用默认属性集和样式创建 DependentLayout 实例。 DependentLayout(Context context, AttrSet attrSet) 用于在 XML 文件解析后使用指定的属性集和默认样式创建 DependentLayout 实例的构造函数。 DependentLayout(Context context, AttrSet attrSet, String styleName) 用于在解析 XML 文件后使用指定的属性集和指定的样式创建 DependentLayout 实例的构造函数。 方法总结 修饰符和类型 方法 描述 ComponentContainer.LayoutConfig createLayoutConfig(Context context, AttrSet attrSet) 使用子组件的属性集创建布局参数。 int getAlignment() 获取依赖布局中子组件的对齐方式。 int getGravity() 获取依赖布局中子组件的对齐方式。 int getIgnoreAlignment() 获取不受其父容器对齐属性约束的子组件的ID。 int getIgnoreGravity() 获取不受其父组件对齐属性约束的子组件的ID。 void setAlignment(int alignment) 设置依赖布局中子组件的对齐方式。 void setGravity(int gravity) 设置依赖布局中子组件的对齐方式。 void setIgnoreAlignment(int componentId) 设置不受其父容器属性约束的子组件的 ID。 void setIgnoreGravity(int componentId) 设置不受其父组件属性约束的子组件的ID。 ComponentContainer.LayoutConfig verifyLayoutConfig(ComponentContainer.LayoutConfig config) 根据当前布局类型验证布局参数。 从类 ohos.agp.components.Component 继承的方法 addDrawTask, addDrawTask, addScrolledListener, announceAccessibility, arrange, bindCornerMark, callOnClick, canScroll, clearFocus, createAnimatorProperty, disableFadeEffect, draw, enableCornerMark, enableFadeEffect, enableSaveState, enableScrollBar, estimateSize, executeDoubleClick, executeLongClick, 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, getFadeEffectBoundaryWidth, 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, invalidate, isBoundaryFadeEffectEnable, isBoundToWindow, isClickable, isClipToContourEnabled, isComponentDisplayed, isEnabled, isFadeEffected, isFocusable, isFocused, isIdentityMatrix, isLongClickOn, isPressed, isRtl, isSaveStateEnabled, isScrollbarFadingOn, isScrollBarOn, isScrollbarOverlapEnabled, isSelected, isSoundEnable, isTouchFocusable, isVibrationEffectEnabled, notifyAccessibility, onAttributeConfigChanged, onRestoreState, onRtlChanged, 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, setFadeEffectBoundaryWidth, 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 从类 ohos.agp.components.ComponentContainer 继承的方法 addComponent, addComponent, addComponent, addComponent, addComponent, dispatchRestoreState, dispatchSaveState, findComponentById, findComponentHolderById, getAutoLayout, getChildCount, getChildIndex, getComponentAt, getComponentTransition, getFocusOrder, getLayoutManager, informConfigurationChanged, isClipToChildBoundsEnabled, isClipToPaddingBoundsEnabled, isTouchEventSplitable, moveChildToFront, onDrag, removeAllComponents, removeComponent, removeComponentAt, removeComponentById, removeComponents, setArrangeListener, setAutoLayout, setAutoLayout, setClipToChildBoundsEnabled, setClipToPaddingBoundsEnabled, setComponentTransition, setFocusOrder, setLayoutManager, setTouchEventSplitable 从接口 ohos.agp.components.ComponentParent 继承的方法 getComponentParent, postLayout 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 构造函数详细信息 DependentLayout public DependentLayout(Context context) 默认构造函数用于使用默认属性集和样式创建 DependentLayout 实例。 参数: 参数名称 参数描述 context 指示应用程序上下文。 DependentLayout public DependentLayout(Context context, AttrSet attrSet) 用于在 XML 文件解析后使用指定的属性集和默认样式创建 DependentLayout 实例的构造函数。 参数:...

鸿蒙OS DatePicker

DatePicker java.lang.Object |—ohos.agp.components.Component |—|—ohos.agp.components.ComponentContainer |—|—|—ohos.agp.components.StackLayout |—|—|—|—ohos.agp.components.DatePicker public class DatePicker extends StackLayout 提供用于选择日期的日期选择器。 此方法允许用户使用年、月和日列选择日期。 如果只需要年或月,或者年月日的顺序需要自定义,则使用DateOrder。 嵌套类摘要 修饰符和类型 类 描述 static interface DatePicker.DateOrder 定义 DatePicker 组件的显示格式。 static interface DatePicker.ValueChangedListener 提供日期更改的侦听器。 从类 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.StackLayout 继承的嵌套类/接口 StackLayout.LayoutConfig 字段摘要 修饰符和类型 字段 描述 static float ROTATION_SENSITIVITY_DEFAULT 指示 DatePicker 响应旋转表冠事件的默认旋转灵敏度。 static float ROTATION_SENSITIVITY_HIGH 指示 DatePicker 响应旋转表冠事件的高旋转灵敏度。 static float ROTATION_SENSITIVITY_LOW 指示 DatePicker 响应旋转表冠事件的低旋转灵敏度。 从类 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 构造函数摘要 构造函数 描述 DatePicker(Context context) 默认构造函数用于使用默认属性集和样式创建 DatePicker 实例。 DatePicker(Context context, AttrSet attrSet) 用于在 XML 文件解析后使用指定的属性集和默认样式创建 DatePicker 实例的构造函数。 DatePicker(Context context, AttrSet attrSet, String styleName) 用于在 XML 文件解析后使用指定的属性集和指定的样式创建 DatePicker 实例的构造函数。 方法总结 修饰符和类型 方法 描述 int getDateOrder() 获取日期格式。 int getDayOfMonth() 获取日期选择器中设置的日期。 Element getDisplayedBottomElement() 获取用于在日期选择器中选定数字的底部绘制分割线的 Element 实例。 Element getDisplayedTopElement() 获取用于在日期选择器中选定数字的顶部绘制分割线的 Element 实例。 long getMaxDate() 获取日期选择器支持的最大日期。 long getMinDate() 获取日期选择器支持的最小日期。 int getMonth() 获取日期选择器中设置的月份。 Color getNormalTextColor() 获取日期选择器中普通文本的颜色。 Font getNormalTextFont() 获取普通文本的字体。 int getNormalTextSize() 获取日期选择器中普通文本的大小。 Element getOperatedTextBackgroundElement() 获取元素集作为正在操作的选中项的文本背景。 Color getOperatedTextColor() 获取日期选择器中被操作文本的颜色。 float getSelectedNormalTextMarginRatio() 获取此日期选择器中所选文本边距与正常文本边距的比率。 Element getSelectedTextBackgroundElement() 获取元素集作为日期选择器选择的文本的背景。 Color getSelectedTextColor() 获取日期选择器中选定文本的颜色。 Font getSelectedTextFont() 获取选定文本的字体。 int getSelectedTextSize()...

鸿蒙OS CornerMark.CornerMarkCleaner

CornerMark.CornerMarkCleaner java.lang.Object |—ohos.agp.components.CornerMark.CornerMarkCleaner protected static class CornerMark.CornerMarkCleaner extends Object 表示角标记的清洁器类。 当角标对象无用时,调用该类中的方法清理角标。 字段摘要 修饰符和类型 字段 描述 protected long mNativePtr Indicates the pointer to the corner mark. 构造函数摘要 构造函数 描述 CornerMarkCleaner(long nativePtr) 用于创建 CornerMarkCleaner 实例的构造函数。 方法总结 修饰符和类型 方法 描述 void run() 运行清洁器以清洁角落标记。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 字段详细信息 mNativePtr protected long mNativePtr 指示指向角标记的指针。 构造函数详细信息 CornerMarkCleaner public CornerMarkCleaner(long nativePtr) 用于创建 CornerMarkCleaner 实例的构造函数。 参数: 参数名称 参数描述 nativePtr 指示指向角标记的指针。 方法详情 run public void run() 运行清洁器以清洁角落标记。

鸿蒙OS CornerMark

CornerMark java.lang.Object |—ohos.agp.components.CornerMark public class CornerMark extends Object 表示一个角标记类来标记组件。 为容器中的组件添加角标记元素,以在组件顶部显示角标记。 嵌套类摘要 修饰符和类型 类 描述 protected static class CornerMark.CornerMarkCleaner 表示角标记的清洁器类。 方法总结 修饰符和类型 方法 描述 ShapeElement getElement() 获取角标的形状元素。 int getHeight() 获取角标记的高度。 String getText() 获取角标中的文本。 Color getTextColor() 获取角标中显示的文本的颜色。 int getTextSize() 获取角标中显示的文本的大小。 int getWidth() 获取角标记的宽度。 protected void registerCleaner() 注册角标记清洁剂。 void setElement(ShapeElement element) 设置角标记的形状元素。 void setHeight(int height) 设置角标记的高度。 void setText(String text) 设置要在角标记中显示的文本。 void setTextColor(Color txtColor) 设置角标记中显示的文本的颜色。 void setTextSize(int textSize) 设置要在角标记中显示的文本大小。 void setWidth(int width) 设置角标记的宽度。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 方法详情 registerCleaner protected void registerCleaner() 注册角标记清洁剂。 setText public void setText(String text) 设置要在角标记中显示的文本。 参数: 参数名称 参数描述 text 指示要设置的文本。 getText public String getText() 获取角标中的文本。 返回: 返回角标记中的文本。 getElement public ShapeElement getElement() 获取角标的形状元素。 返回: 返回当前角标记的形状元素。 setElement public void setElement(ShapeElement element) 设置角标记的形状元素。 参数: 参数名称 参数描述 element 指示给定的形状元素。 setWidth public void setWidth(int width) 设置角标记的宽度。 参数: 参数名称 参数描述 width 表示要设置的宽度。 getWidth public int...