Styling and Implementing Buttons in HarmonyOS ArkUI
Creating a Circular Button
A circular button can be created by setting the ButtonType to Circle.
Button('Circle', { type: ButtonType.Normal, stateEffect: false })
.backgroundColor(0x317aff)
.width(90)
.height(90)
Note: The borderRadius property cannot be used to override the shape of a Circle type button.
Customizing Button Appearance
Va ...
Posted on Sat, 20 Jun 2026 16:52:25 +0000 by xsaero00
Text and Span Components in HarmonyOS ArkUI
In HarmonyOS ArkUI, the Text component serves as a container for displaying text content, while the Span component allows for styling specific portions of text within a Text container. The key distinction is that Text provides the overall container and layout properties, whereas Span enables granular text formatting within that container.
Text ...
Posted on Mon, 15 Jun 2026 17:57:03 +0000 by olidenia
Exporting C++ Class Objects via Node-API and Managing Their Lifecycle
Sample Project Source Code Analysis
The sample project uses a Native C++ template with the Stage model. This analysis focuses on key implementation files for class object export and lifecycle management.
Class Definition and Method Implementation
NapiTest.h Header File
#ifndef __NAPI_TEST_H__
#define __NAPI_TEST_H__
#include "napi/native_ ...
Posted on Thu, 11 Jun 2026 18:28:49 +0000 by itworks
HarmonyOS App Development with Java: A Quick Start
Development Environment
The official IDE for HarmonyOS is DevEco Studio, which, like Android Studio, is built upon the open-source IntelliJ IDEA Community Edition from JetBrains. The user interface is nearly identical to what Android developer are already familiar with.
Currantly, DevEco Studio only supports Windows; Mac users will need a Windo ...
Posted on Mon, 08 Jun 2026 18:20:05 +0000 by Whetto
Implementing Radio Buttons in HarmonyOS ArkUI
Handling Radio Button Events
In HarmonyOS ArkTS, the Radio component allows users to select one option from a group. Each radio button must share the same group value to ensure mutual exclusivity. Event handling is done via the .onChange() modifier.
// Example: Basic Radio Group with Logging
import router from '@ohos.router';
@Entry
@Component ...
Posted on Sun, 07 Jun 2026 17:31:14 +0000 by perry789
Implementing Custom Notifications in HarmonyOS
Overview
This example demonstrates how to create and manage various types of notifications using @ohos.notificationManager and related APIs. It covers publishing, canceling, and setting badge counts on the desktop for different notification formats including basic, long text, multi-line, image-based, button-enabled, and app-launching notificati ...
Posted on Sat, 06 Jun 2026 17:39:35 +0000 by forcer
Working with Application Context in HarmonyOS Stage Model
In the Stage model, different contexts offer varying scopes of data and capabillities. AbilityStageContext extends the base Context by exposing HapModuleInfo and Configuration details specific to the module stage. Meanwhile, ApplicationContext serves as the global hub, allowing deveolpers to monitor ability lifecycles, memory shifts, and system ...
Posted on Fri, 05 Jun 2026 18:08:11 +0000 by puritania
Building a Decoupled Custom Dialog System with ArkUI's Navigation.Dialog
Custom dialogs are essential in mobile application interfaces, covering modal, semi-modal, toast, and other overlay styles. A well-designed dialog component should be independent of specific UI pages and easily triggered from business logic.
Common real-world needs include:
Triggering dialogs from shared services (login prompts, full-screen ad ...
Posted on Wed, 03 Jun 2026 16:24:26 +0000 by sitorush
HarmonyOS ArkUI Event Handling: Mouse and Keyboard Events
Mouse Events
The onMouse event handler responds to various user interactions with the mouse interface. This callback function triggers when users perform mouse actions on the UI, enabling developers to capture and respond to mouse clicks, movements, scrolling, hovering, and other mouse-related operations.
The syntax for the onMouse event handle ...
Posted on Tue, 19 May 2026 06:32:44 +0000 by bdamod1
Implementing Media Session (Provider) with HarmonyOS
Overview
This sample demonstrates the media session provider functionality using the @ohos.multimedia.avsession API. It enables custom data exchange between a media provider and a media controller.
Note: This sample only shows the provider side. For the complete custom interaction feature, use both the provider and controller samples together.
...
Posted on Tue, 19 May 2026 01:48:08 +0000 by ManicMax