harmony 鸿蒙@ohos.file.picker (Picker) (System API)

  • 2025-06-12
  • 浏览 (5)

@ohos.file.picker (Picker) (System API)

The Picker module encapsulates APIs such as PhotoViewPicker, DocumentViewPicker, and AudioViewPicker to provide capabilities of selecting and saving files of different types. An application can select the API as required. The APIs of this module must be called in UIAbility. Otherwise, the photoPicker or FilePicker cannot be started. > NOTE > > - The initial APIs of this module are supported since API version 9. Updates will be marked with a superscript to indicate their earliest API version. > - This topic describes only the system APIs provided by the module. For details about its public APIs, see @ohos.file.picker (Picker).

Modules to Import

import  { picker } from '@kit.CoreFileKit';

DocumentSelectOptions

Defines the options for selecting documents.

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

System capability: SystemCapability.FileManagement.UserFileService

Properties

Name Type Read-Only Optional Description
themeColor18+ CustomColors No Yes Theme color parameter. By default, it is left empty and follows the color settings of the FilePicker. When it is set to specific theme color properties, such as brand, fontPrimary, compBackgroundEmphasize, and iconFourth, the launched FilePicker will adapt to the theme color accordingly.
System capability: SystemCapability.FileManagement.UserFileService. Only mobile phones are supported.

DocumentSaveOptions

Defines the options for saving documents.

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

System capability: SystemCapability.FileManagement.UserFileService

Properties

Name Type Read-Only Optional Description
themeColor18+ CustomColors No Yes Theme color parameter. By default, it is left empty and follows the color settings of the FilePicker. When it is set to specific theme color properties, such as fontEmphasize and compBackgroundEmphasize, the launched FilePicker will adapt to the theme color accordingly.
System capability: SystemCapability.FileManagement.UserFileService. Only mobile phones are supported.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Core File Kit

harmony 鸿蒙Environment

harmony 鸿蒙FileIO

harmony 鸿蒙FileShare_PolicyErrorResult

harmony 鸿蒙FileShare_PolicyInfo

harmony 鸿蒙error_code.h

harmony 鸿蒙File Management Error Codes

harmony 鸿蒙FileShare

harmony 鸿蒙FileUri

harmony 鸿蒙@ohos.application.BackupExtensionAbility (Backup and Restore Extension Capability) (System API)

0  赞