Geometric Shape Drawing Overview
There are two methods for drawing geometric shapes: (1) by directly drawing them using the Shape component; (2) by clipping a component into a geometric shape using the shape clipping attribute clipShape.
When to Use
| Method | Use Case |
|---|---|
| Drawing geometric shapes (Shape) | Create components of a specified shape and draw geometric graphics directly on the page. |
| Shape clipping (clipShape) | Clip a component into a specified geometric shape. |
Constraints
-
For the Shape component: You can use the Shape component as a parent container to achieve SVG-like effects, or use its various child components independently for drawing.
-
For the clipShape attribute: Clipping does not prevent the clipped area from responding to bound gesture events.
你可能感兴趣的鸿蒙文章
openharmony 鸿蒙 arkts-common-components-text-input
openharmony 鸿蒙 arkts-select-component-faq
openharmony 鸿蒙 js-framework-syntax-css
openharmony 鸿蒙 arkts-popup-and-menu-components-popup
openharmony 鸿蒙 arkts-navigation-animation-faq
openharmony 鸿蒙 arkts-rotation-transition-animation
openharmony 鸿蒙 ndk-inspector-component-observer
openharmony 鸿蒙 arkts-popup-and-menu-components-uicontext-popup