提交 9cf51a3d 编写于 作者: E ester.zhou

Update docs (22623)

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 37e403cf
...@@ -17,25 +17,29 @@ The following sample code implements the animation effect of button rotation: ...@@ -17,25 +17,29 @@ The following sample code implements the animation effect of button rotation:
![WidgetAnimation](figures/WidgetAnimation.gif) ![WidgetAnimation](figures/WidgetAnimation.gif)
```ts ```ts
@Entry @Entry
@Component @Component
struct AttrAnimationExample { struct AnimationCard {
@State rotateAngle: number = 0; @State rotateAngle: number = 0;
build() { build() {
Column() { Row() {
Button('change rotate angle') Button('change rotate angle')
.height('20%')
.width('90%')
.margin('5%')
.onClick(() => { .onClick(() => {
this.rotateAngle = 90; this.rotateAngle = (this.rotateAngle === 0 ? 90 : 0);
}) })
.margin(50)
.rotate({ angle: this.rotateAngle }) .rotate({ angle: this.rotateAngle })
.animation({ .animation({
curve: Curve.EaseOut, curve: Curve.EaseOut,
playMode: PlayMode.AlternateReverse playMode: PlayMode.Normal,
}) })
}.width('100%').margin({ top: 20 }) }.height('100%').alignItems(VerticalAlign.Center)
} }
} }
``` ```
...@@ -6,7 +6,7 @@ You can apply custom drawing in your ArkTS widget to create a more vibrant exper ...@@ -6,7 +6,7 @@ You can apply custom drawing in your ArkTS widget to create a more vibrant exper
```ts ```ts
@Entry @Entry
@Component @Component
struct WidgetCard { struct CanvasCard {
private canvasWidth: number = 0; private canvasWidth: number = 0;
private canvasHeight: number = 0; private canvasHeight: number = 0;
// Initialize CanvasRenderingContext2D and RenderingContextSettings. // Initialize CanvasRenderingContext2D and RenderingContextSettings.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册