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)

Amit

I write about Huawei Latest News, EMUI Updates & more. I am also a fitness freak. For any information, tip or help send me an email at huaweiupdatenews@gmail.com

Share
Published by
Amit

Recent Posts

Huawei Petal Mail App will no longer be available for download

According to the official information, the Huawei released the delisting announcement of its Petal Mail…

5 months ago

Huawei Health App 15.0.10.310 update is now rolling out

Huawei has started rolling out the new November 2024 app update to its Health Application.…

5 months ago

Huawei Mate 70 lineup repair spare parts prices announced

Huawei released the Mate 70 series of mobile phones, with a starting price of 5,499…

5 months ago

Huawei FreeBuds Pro 4 official announcement

Huawei officially announced the new FreeBuds Pro 4 headphones. This is the first TWS headset…

5 months ago

Huawei Mate 70 lineup reservations exceeded 560,000 in 20 minutes

Huawei's Mate 70 series of mobile phones was officially unveiled today. The new series of…

5 months ago

Huawei Mate 70 lineup launch event details revealed: Mate X6, MatePad Pro 13.2 and more

According to the latest information, the Chinese tech giant Huawei is said to launch the…

6 months ago