openharmony 鸿蒙 ts-picker-common

2026-08-25 浏览 (1)

Picker Common APIs

This topic covers the common APIs of picker components.

NOTE

The initial APIs of this module are supported since API version 10. Updates will be marked with a superscript to indicate their earliest API version.

PickerTextStyle

Defines the text style configuration for the picker component.

Atomic service API: This API can be used in atomic services since API version 11.

System capability: SystemCapability.ArkUI.ArkUI.Full

NameTypeRead-OnlyOptionalDescription
colorResourceColorNoYesText color.
fontFontNoYesText style.

PickerDialogButtonStyle12+

Defines the button style of the picker dialog box.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.ArkUI.ArkUI.Full

NameTypeRead-OnlyOptionalDescription
typeButtonTypeNoYesButton type.
styleButtonStyleModeNoYesStyle and importance of the button.
roleButtonRoleNoYesRole of the button.
fontSizeLengthNoYesFont size of the button.
fontColorResourceColorNoYesColor of button text.
fontWeightFontWeight | number | stringNoYesFont weight of button text For the number type, the value ranges from 100 to 900, at an interval of 100. A larger value indicates a heavier font weight. For the string type, only strings that represent a number, for example, "200", and the following enumerated values of FontWeight are supported: "bold", "bolder", "lighter", "regular", and "medium".
fontStyleFontStyleNoYesFont style of button text.
fontFamilyResource | stringNoYesFont family. The 'HarmonyOS Sans' font and registered custom fonts are supported.
backgroundColorResourceColorNoYesBackground color of the button.
borderRadiusLength |BorderRadiusesNoYesCorner radius of the button.
primarybooleanNoYesWhether the button responds to the Enter key by default when the dialog box is displayed and the Tab key is not used for sequential focus navigation.
true: After the dialog box is displayed and the Tab key is not used for sequential focus navigation, pressing the Enter key triggers the event bound to the button.
false: After the dialog box is displayed and the Tab key is not used for sequential focus navigation, pressing the Enter key does not trigger the event bound to the button.
Default value: false.

DateRange19+

Defines the date range, which specifies the start and end dates.

Atomic service API: This API can be used in atomic services since API version 19.

System capability: SystemCapability.ArkUI.ArkUI.Full

NameTypeRead-OnlyOptionalDescription
startDateNoYesStart date of the date range.
endDateNoYesEnd date of the date range.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 ts-drawing-components-shape

openharmony 鸿蒙 ts-universal-attributes-sharp-clipping

openharmony 鸿蒙 ts-universal-attributes-toolbar

openharmony 鸿蒙 ts-container-lazyvgridlayout

openharmony 鸿蒙 ohos-arkui-advanced-FoldSplitContainer

openharmony 鸿蒙 ts-methods-calendarpicker-dialog

openharmony 鸿蒙 ts-uicommonevent

openharmony 鸿蒙 ts-basic-gestures-tapgesture

openharmony 鸿蒙 ohos-arkui-advanced-DialogV2

openharmony 鸿蒙 ts-components-canvas-canvas

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/AC3sxVj9