目录

Picker Common APIs

This topic covers the common APIs of picker components.

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

Name Type Read-Only Optional Description
color ResourceColor No Yes Text color.
font Font No Yes Text 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

Name Type Read-Only Optional Description
type ButtonType No Yes Button type.
style ButtonStyleMode No Yes Style and importance of the button.
role ButtonRole No Yes Role of the button.
fontSize Length No Yes Font size of the button.
fontColor ResourceColor No Yes Color of button text.
fontWeight FontWeight | number | string No Yes Font 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".
fontStyle FontStyle No Yes Font style of button text.
fontFamily Resource | string No Yes Font family. The 'HarmonyOS Sans' font and registered custom fonts are supported.
backgroundColor ResourceColor No Yes Background color of the button.
borderRadius Length | BorderRadiuses No Yes Corner radius of the button.
primary boolean No Yes

Whether 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

Name Type Read-Only Optional Description
start Date No Yes Start date of the date range.
end Date No Yes End date of the date range.