Harmony OS 2

Huawei HarmonyOS 2 adds 5 practical examples of Sample: Grid layout, adaptive card and more

Huawei HarmonyOS has released the new Sample this week, and five super practical examples have been added. Click the download link below to download and learn!

Sample 1: Add NativeLayer sample

Scenario: Native_layer declares the JNI related to the native layer. This example shows the use of the JNI interface on Native_layer, so that the application can obtain the native layer that matches the Java surface object, obtain the native layer information, and also set the native layer size and layer grid.

● Download link:

https://gitee.com/openharmony/app_samples/tree/master/native/NativeLayer

Advertisement

Sample 2: New grid layout

Scenario: This example uses a grid system for element layout, which is mainly implemented by the <grid-container\>, <grid-row\>, and <grid-col\> tags.

● Download link:

https://gitee.com/openharmony/app_samples/tree/master/UI/JsGrid

Sample 3: New JS canvas example

Advertisement

Scenario: The <canvas\> component can be customized to draw graphics. This example shows how to use the <canvas\> component.

●Download link:

https://gitee.com/openharmony/app_samples/tree/master/UI/JsCanvas

Sample 4: New adaptive page and adaptive efficiency homepage example

Scenario: This example uses five types of immersive cards, graphic cards, grid cards, plain text cards, and multi-dimensional information cards to demonstrate the adaptive capabilities of cards on devices of different sizes. When the card is extremely wide and extremely high, the card will be displayed through adaptive capabilities such as stretching, zooming, hiding, folding, and evenly dividing.

Advertisement

● Download link:

https://gitee.com/openharmony/app_samples/tree/master/UI/JsAdaptivePortalPage

Sample 5: New adaptive card example

Scenario: This example shows a list page. On devices of different sizes, through adaptive capabilities such as stretching, zooming, sharing, and proportioning, it uses polymorphic controls, the extensibility of layouts and components, and the use of responsive layouts. , Adaptive display is a reasonable layout effect.

● Download link:

Advertisement

https://gitee.com/openharmony/app_samples/tree/master/UI/JsAdaptiveServiceWidget

If you have any questions or needs during use, please submit an issue on Gitee.

(Via)

Min

Min En specializes in smartphone reviews, EMUI/HarmonyOS coverage, and mobile industry analysis. His in-depth knowledge of Huawei's ecosystem, from flagship devices to emerging technologies, makes him a trusted voice in the tech community.

Recent Posts

Huawei Mate 70 Air shows up in a promotional photo

Huawei is getting ready to release a new super-thin phone called the Mate 70 Air.…

3 months ago

Huawei Mate 80 series latest Information

Tipster Digital Chat Station has confirmed that the Chinese tech giant Huawei will release new…

5 months ago

Huawei’s Xu Zhijun steps down as chairman

A Chinese company called HiSilicon Semiconductor just changed who's in charge. The old boss, Xu…

5 months ago

HUAWEI MatePad Mini complete info

HUAWEI has introduced the all-new MatePad Mini tablet, in China. As per the specifications, the…

5 months ago

Huawei Watch GT 6 and Watch GT 6 Pro spotted on TDRA Certification Database

New details have been confirmed about the upcoming Huawei Watch GT 6 and Huawei Watch…

6 months ago

Huawei Nigeria to Host 2025 Job Fair

Huawei Technologies Company Nigeria Limited has announced the 2025 Huawei Job Fair, set to take…

6 months ago