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

Harmony OS 2

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

Published

on

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

Advertisement

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:

Advertisement

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

Sample 2: New grid layout

Advertisement

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:

Advertisement

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:

Advertisement

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

Sample 4: New adaptive page and adaptive efficiency homepage example

Advertisement

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.

● Download link:

Advertisement

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

Sample 5: New adaptive card example

Advertisement

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.

Advertisement

(Via)

Advertisement

Leave a Reply

Your email address will not be published. Required fields are marked *

Most Popular

Exit mobile version