提交 8342a17f 编写于 作者: E ester.zhou

update docs

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 3cd5d7c6
...@@ -3,13 +3,6 @@ ...@@ -3,13 +3,6 @@
## setTimeout ## setTimeout
## Modules to Import
```
import Time from '@ohos.Time';
```
setTimeout(handler[,delay[,…args]]): number setTimeout(handler[,delay[,…args]]): number
Sets a timer for the system to call a function after the timer goes off. Sets a timer for the system to call a function after the timer goes off.
......
# Shape Clipping # Shape Clipping
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > **NOTE**
>
> This attribute is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. > This attribute is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
...@@ -13,16 +14,17 @@ None ...@@ -13,16 +14,17 @@ None
## Attributes ## Attributes
| Name | Type | Default Value | Description | | Name | Type | Default Value | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| clip | Shape \| boolean | false | Specifies a clip mode. The value **Shape** indicates that the current component is cropped based on the specified shape. The value **boolean** specifies whether to clip the component based on the edge outline. | | clip | Shape \| boolean | false | Clip mode. The value **Shape** indicates that the current component is cropped based on the specified shape. The value **boolean** specifies whether to clip the component based on the edge outline. |
| mask | Shape | - | Adds a mask of the specified shape to the current component. | | mask | Shape | - | Mask of the specified shape for the current component. |
## Example ## Example
``` ```ts
// xxx.ets
@Entry @Entry
@Component @Component
struct ClipAndMaskExample { struct ClipAndMaskExample {
...@@ -30,24 +32,24 @@ struct ClipAndMaskExample { ...@@ -30,24 +32,24 @@ struct ClipAndMaskExample {
Column({ space: 5 }) { Column({ space: 5 }) {
Text('clip').fontSize(9).width('90%').fontColor(0xCCCCCC) Text('clip').fontSize(9).width('90%').fontColor(0xCCCCCC)
// Clip the image by using a circle with a diameter of 280px. // Clip the image by using a circle with a diameter of 280px.
Image('/comment/bg.jpg') Image($r('app.media.example'))
.clip(new Circle({ width: 80, height: 80 })) .clip(new Circle({ width: 80, height: 80 }))
.width('500px').height('280px') .width('500px').height('280px')
Row() { Row() {
Image('/comment/bg.jpg').width('500px').height('280px') Image($r('app.media.example')).width('500px').height('280px')
} }
.clip(true) .clip(true)
.borderRadius(20) .borderRadius(20)
Text('mask').fontSize(9).width('90%').fontColor(0xCCCCCC) Text('mask').fontSize(9).width('90%').fontColor(0xCCCCCC)
// Add a 500 px x 280 px mask to the image. // Add a 500 px x 280 px mask to the image.
Image('/comment/bg.jpg') Image($r('app.media.example'))
.mask(new Rect({ width: '500px', height: '280px' }).fill(Color.Gray)) .mask(new Rect({ width: '500px', height: '280px' }).fill(Color.Gray))
.width('500px').height('280px') .width('500px').height('280px')
// Add a 280 px x 280 px circle mask to the image. // Add a 280 px x 280 px circle mask to the image.
Image('/comment/bg.jpg') Image($r('app.media.example'))
.mask(new Circle({ width: '280px', height: '280px' }).fill(Color.Gray)) .mask(new Circle({ width: '280px', height: '280px' }).fill(Color.Gray))
.width('500px').height('281px') .width('500px').height('281px')
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册