本示例通过拉起系统相机实现发布图片评论。
| Files | Last commit | Last update |
|---|---|---|
| 2 years ago | ||
| 1 year ago | ||
| 2 years ago | ||
| 1 year ago | ||
| 2 years ago | ||
| 1 year ago | ||
| 1 year ago | ||
| 1 year ago | ||
| 2 years ago | ||
| 1 year ago |
Posting an Image Comment
Overview
This sample shows how to post a comment on an image by starting the system camera.
Preview

How to Use
-
Open the app. Touch the text box, and then touch the camera button to start the system camera.
-
Take a photo, return the app page, and touch the button to post it.
Project Directory
├──entry/src/main/ets
│ ├──commmon
│ │ └──CommonConstants.ets // Common constants
│ ├──entryability
│ │ └──EntryAbility.ets // Entry ability
│ ├──model
│ │ ├──CommentModel.ets // Comment class
│ │ └──MockCommentData.ets // Comment data
│ ├──pages
│ │ └──Index.ets // Home page
│ ├──utils
│ │ └──CameraUtils.ets // Start the camera
│ └──view
│ ├──CommentInputDialog.ets // Post comment dialog box
│ ├──CommentItemView.ets // Comment components
│ └──ImageListView.ets // Comment image list
└──entry/src/main/resources // Static resources
Required Permissions
N/A
Constraints
-
The sample app is supported only on Huawei phones running the standard system.
-
The HarmonyOS version must be HarmonyOS 5.0.5 Release or later.
-
The DevEco Studio version must be DevEco Studio 5.0.5 Release or later.
-
The HarmonyOS SDK version must be HarmonyOS 5.0.5 Release SDK or later.