优惠码 第44页 IndexBar.OnSelectedListener public static interface IndexBar.OnSelectedListener 回调以侦听和索引索引栏的更改事件。 方法总结 修饰符和类型 方法 描述 void onSelected(int index) 获取索引栏上的当前索引号。 方法详情 onSelected void onSelected(int index) 获取索引栏上的当前索引号。 参数: 参数名称 参数描述 index 指示索引栏上的当前索引号。
2024-04-03
DatePicker.ValueChangedListener public static interface DatePicker.ValueChangedListener 提供日期更改的侦听器。 您必须重写此类中的 onValueChanged(ohos.agp.components.DatePicker, int, int, int) 方法来侦听和处理 DatePicker 项的日期更改事件。 方法总结 修饰符和类型 方法 描述 void onValueChanged(DatePicker component, int year, int monthOfYear, int dayOfMonth) 处理日期选择器的日期更改事件。 方法详情 onValueChanged void onValueChanged(DatePicker component, int year, int monthOfYear, int dayOfMonth) 处理日期选择器的日期更改事件。 在 DatePicker 触发的日期更改事件时调用此方法。 它传递最新日期以处理日期更改事件。 参数: 参数名称 参数描述 component 指示与侦听器关联的组件(一个 DatePicker 实例)。 year 表示用户设置的年份(0 或更大)。 monthOfYear 表示用户设置的月份(1 到 12)。 dayOfMonth 表示用户设置的日期(1 到当月的总天数)。
2024-04-03
DatePicker.DateOrder public static interface DatePicker.DateOrder 定义 DatePicker 组件的显示格式。 例如,日期可以以年-月-日或月-日-年的格式显示。 字段摘要 修饰符和类型 字段 描述 static int DAY 表示仅显示日期。 static int DM 表示日期以日月格式显示。 static int DMY 表示日期以日-月-年格式显示。 static int MD 表示日期以月日格式显示。 static int MDY 表示日期以月-日-年格式显示。 static int MONTH 表示只显示月份。 static int MY 表示日期以月-年格式显示。 static int YDM 表示日期以年-日-月格式显示。 static int YEAR 表示只显示年份。 static int YM 表示日期以年月格式显示。 static int YMD 表示日期以年-月-日格式显示。 字段详细信息 DAY static final int DAY 表示仅显示日期。 DM static final int DM 表示日期以日月格式显示。 DMY static final int DMY 表示日期以日-月-年格式显示。 MD static final int MD 表示日期以月日格式显示。 MDY static final int MDY 表示日期以月-日-年格式显示。 MONTH static final int MONTH 表示只显示月份。 MY static final int MY 表示日期以月-年格式显示。 YDM static final int YDM 表示日期以年-日-月格式显示。 YEAR static final int YEAR 表示只显示年份。 YM static final int YM 表示日期以年月格式显示。 YMD static final int YMD 表示日期以年-月-日格式显示。
2024-04-03
ComponentTreeObserver.WindowFocusUpdatedListener public static interface ComponentTreeObserver.WindowFocusUpdatedListener 当组件层次结构中窗口焦点状态发生变化时调用的回调。 此侦听器由 ComponentTreeObserver 定义。 方法总结 修饰符和类型 方法 描述 void onWindowFocusUpdated(boolean hasFocus) 当窗口焦点状态改变时调用的回调。 方法详情 onWindowFocusUpdated void onWindowFocusUpdated(boolean hasFocus) 当窗口焦点状态改变时调用的回调。 参数: 参数名称 参数描述 hasFocus 指示窗口是否获得焦点。
2024-04-03
ComponentTreeObserver.WindowBoundListener public static interface ComponentTreeObserver.WindowBoundListener 当组件层次结构绑定到其窗口或从其窗口解除绑定时调用的回调。 此侦听器由 ComponentTreeObserver 定义。 方法总结 修饰符和类型 方法 描述 void onWindowBound() 当组件层次结构绑定到新窗口时要调用的回调方法。 void onWindowUnbound() 当组件层次结构与窗口解除绑定时要调用的回调方法。 方法详情 onWindowBound void onWindowBound() 当组件层次结构绑定到新窗口时要调用的回调方法。 onWindowUnbound void onWindowUnbound() 当组件层次结构与窗口解除绑定时要调用的回调方法。
2024-04-03
ComponentTreeObserver.ScrollChangedListener public static interface ComponentTreeObserver.ScrollChangedListener 滚动组件层次结构中的任何元素时调用的回调。 此侦听器由 ComponentTreeObserver 定义。 方法总结 修饰符和类型 方法 描述 void onScrolled() 滚动组件层次结构中的任何元素时调用的回调方法。 方法详情 onScrolled void onScrolled() 滚动组件层次结构中的任何元素时调用的回调方法。
2024-04-03
ComponentTreeObserver.GlobalLayoutListener @Deprecatedpublic static interface ComponentTreeObserver.GlobalLayoutListener 已弃用。 此更改从 API 版本 6 开始生效。替换为 Component.LayoutRefreshedListener 方法总结 修饰符和类型 方法 描述 void onGlobalLayoutUpdated() 已弃用。 此更改从 API 版本 6 开始生效。替换为 Component.LayoutRefreshedListener#onRefreshed(Component) 方法详情 onGlobalLayoutUpdated @Deprecated void onGlobalLayoutUpdated() 已弃用。 此更改从 API 版本 6 开始生效。替换为 Component.LayoutRefreshedListener#onRefreshed(Component) 当全局布局状态或组件树中组件的可见性发生变化时调用的回调方法。
2024-04-03
ComponentTreeObserver.GlobalFocusUpdatedListener public static interface ComponentTreeObserver.GlobalFocusUpdatedListener 当组件树中的焦点状态发生变化时调用的回调。 此侦听器由 ComponentTreeObserver 定义。 方法总结 修饰符和类型 方法 描述 void onGlobalFocusUpdated(Component oldFocus, Component newFocus) 当组件树中的焦点状态发生变化时要调用的回调方法。 方法详情 onGlobalFocusUpdated void onGlobalFocusUpdated(Component oldFocus, Component newFocus) 当组件树中的焦点状态发生变化时要调用的回调方法。 参数: 参数名称 参数描述 oldFocus 表示焦点改变前有焦点的组件。 newFocus 表示焦点改变后有焦点的组件。
2024-04-03
ComponentParent public interface ComponentParent 定义父组件的特征。 此类为组件提供与其父组件交互的接口。 方法总结 修饰符和类型 方法 描述 int getChildIndex(Component component) 查询子组件的位置。 ComponentParent getComponentParent() 获取子组件的父组件。 void moveChildToFront(Component component) 调整子组件的 z 顺序,使其位于所有子组件之上。 boolean onDrag(Component component, DragEvent event) 检查拖动事件是否分发到父组件。 void postLayout() 请求父组件重新排列其布局。 void removeComponent(Component component) 从父组件中移除子组件。 void removeComponentAt(int index) 从组件列表中的指定位置移除组件。 void removeComponents(int start, int count) 从组件列表中的指定位置移除所有组件。 ComponentContainer.LayoutConfig verifyLayoutConfig(ComponentContainer.LayoutConfig config) 根据当前布局类型验证布局参数。 方法详情 postLayout void postLayout() 请求父组件重新排列其布局。 getChildIndex int getChildIndex(Component component) 查询子组件的位置。 参数: 参数名称 参数描述 component 指示要查询的子组件。 返回: 返回一个正整数,表示子组件在父组件中的位置; 如果子组件不包含在父组件中,则返回 -1。 removeComponent void removeComponent(Component component) 从父组件中移除子组件。 参数: 参数名称 参数描述 component 指示要移除的子组件。 removeComponentAt void removeComponentAt(int index) 从组件列表中的指定位置移除组件。 参数: 参数名称 参数描述 index 指示要移除的组件的位置索引。 removeComponents void removeComponents(int start, int count) 从组件列表中的指定位置移除所有组件。 参数: 参数名称 参数描述 start 表示第一个移除的组件的位置索引。 count 表示要移除的组件数量。 verifyLayoutConfig ComponentContainer.LayoutConfig verifyLayoutConfig(ComponentContainer.LayoutConfig config) 根据当前布局类型验证布局参数。 参数: 参数名称 参数描述 config 指示要转换为 ComponentContainer 实例的一组布局参数。 返回: 返回 LayoutConfig 实例,它表示布局参数。 getComponentParent ComponentParent getComponentParent() 获取子组件的父组件。 返回: 返回子组件的父组件。 moveChildToFront void moveChildToFront(Component component) 调整子组件的 z 顺序,使其位于所有子组件之上。 z 顺序调整会更改顺序相关的布局。 参数:...
2024-04-03
ComponentContainer.ArrangeListener public static interface ComponentContainer.ArrangeListener 提供自定义组件排列流程的接口。 方法总结 修饰符和类型 方法 描述 boolean onArrange(int left, int top, int width, int height) 通知组件容器在布局时设置子位置和大小 方法详情 onArrange boolean onArrange(int left, int top, int width, int height) 通知组件容器在布局时设置子位置和大小 参数: 参数名称 参数描述 left 表示左边缘的相对位置,以像素为单位。 top 表示上边缘的相对位置,以像素为单位。 width 表示组件宽度,以像素为单位。 height 表示组件高度,以像素为单位。 返回: 如果此组件在 onArrange() 中处理了布局,则应返回 True,并且无需在本机端开始布局,否则返回 false。
2024-04-03