animation-frame.md 1.1 KB
Newer Older
D
DCloud_LXH 已提交
1
### requestAnimationFrame(callback)@requestanimationframe
D
DCloud_LXH 已提交
2

D
DCloud_LXH 已提交
3
<!-- UTSJSON.Global.requestAnimationFrame.description -->
D
DCloud_LXH 已提交
4

D
DCloud_LXH 已提交
5
<!-- UTSJSON.Global.requestAnimationFrame.param -->
D
DCloud_LXH 已提交
6

D
DCloud_LXH 已提交
7
<!-- UTSJSON.Global.requestAnimationFrame.returnValue -->
D
DCloud_LXH 已提交
8

D
DCloud_LXH 已提交
9
<!-- UTSJSON.Global.requestAnimationFrame.test -->
D
DCloud_LXH 已提交
10

D
DCloud_LXH 已提交
11
<!-- UTSJSON.Global.requestAnimationFrame.compatibility -->
D
DCloud_LXH 已提交
12

D
DCloud_LXH 已提交
13
<!-- UTSJSON.Global.requestAnimationFrame.tutorial -->
D
DCloud_LXH 已提交
14

D
DCloud_LXH 已提交
15
### cancelAnimationFrame(taskId) @cancelanimationframe
D
DCloud_LXH 已提交
16

D
DCloud_LXH 已提交
17
<!-- UTSJSON.Global.cancelAnimationFrame.description -->
D
DCloud_LXH 已提交
18

D
DCloud_LXH 已提交
19
<!-- UTSJSON.Global.cancelAnimationFrame.param -->
D
DCloud_LXH 已提交
20

D
DCloud_LXH 已提交
21
<!-- UTSJSON.Global.cancelAnimationFrame.returnValue -->
D
DCloud_LXH 已提交
22

D
DCloud_LXH 已提交
23
<!-- UTSJSON.Global.cancelAnimationFrame.test -->
D
DCloud_LXH 已提交
24

D
DCloud_LXH 已提交
25
<!-- UTSJSON.Global.cancelAnimationFrame.compatibility -->
H
hdx 已提交
26

D
DCloud_LXH 已提交
27
<!-- UTSJSON.Global.cancelAnimationFrame.tutorial -->
28 29

**提示**
H
hdx 已提交
30
- requestAnimationFrame/cancelAnimationFrame 为全局 API,如果需要跨平台处理 canvas 动画应使用 [uni.createCanvasContextAsync]("./create-canvas-context-async.md")
H
hdx 已提交
31
- `Android uni-app x` requestAnimationframe 目前仅支持有参数callback,示例:`requestAnimationFrame((timestamp : number) => {})`