diff --git a/zh-cn/application-dev/reference/apis/figures/zh-cn_image_0000001219864133.PNG b/zh-cn/application-dev/reference/apis/figures/zh-cn_image_0000001219864133.PNG index eababe89d532f5e3f2bdd2e8d6449782054dc348..07ac9bc91d11e50df13af4f435305a4fc62db013 100644 Binary files a/zh-cn/application-dev/reference/apis/figures/zh-cn_image_0000001219864133.PNG and b/zh-cn/application-dev/reference/apis/figures/zh-cn_image_0000001219864133.PNG differ diff --git a/zh-cn/application-dev/reference/apis/js-apis-matrix4.md b/zh-cn/application-dev/reference/apis/js-apis-matrix4.md index 80f9f09ce27b5878c731b92de57971c8bd6edf54..424e3d5b4cddc2ffbd92f00a3e76ed8e7a660d2a 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-matrix4.md +++ b/zh-cn/application-dev/reference/apis/js-apis-matrix4.md @@ -458,7 +458,7 @@ struct Test { .width('600px') .height('300px') .margin({ top: 50 }) - Text(`矩阵变换前的坐标:[${this.transformPoint}]`) + Text(`矩阵变换后的坐标:[${this.transformPoint}]`) .fontSize(16) .margin({ top: 100 }) Image($r("app.media.image")) diff --git a/zh-cn/application-dev/reference/arkui-js/figures/zh-cn_image_0000001127125192.gif b/zh-cn/application-dev/reference/arkui-js/figures/zh-cn_image_0000001127125192.gif index 3c65871bb208133129e46956ecee119276a390a5..3c5b1fa0343c2e6ec1ebf8592ed769e25fc5b2c4 100644 Binary files a/zh-cn/application-dev/reference/arkui-js/figures/zh-cn_image_0000001127125192.gif and b/zh-cn/application-dev/reference/arkui-js/figures/zh-cn_image_0000001127125192.gif differ diff --git a/zh-cn/application-dev/reference/arkui-js/figures/zh-cn_image_0000001127285004.gif b/zh-cn/application-dev/reference/arkui-js/figures/zh-cn_image_0000001127285004.gif index e83e2ce11234a97242e1f57204b96568ad248d3d..dcb1ff67a62b1053d3e1c392bbe0535e81771c54 100644 Binary files a/zh-cn/application-dev/reference/arkui-js/figures/zh-cn_image_0000001127285004.gif and b/zh-cn/application-dev/reference/arkui-js/figures/zh-cn_image_0000001127285004.gif differ diff --git a/zh-cn/application-dev/reference/arkui-js/figures/zh-cn_image_0000001167823326.gif b/zh-cn/application-dev/reference/arkui-js/figures/zh-cn_image_0000001167823326.gif index 1589d8650fa225626fb8dadf085732f92170e40f..78a6830c434d54aab7beba2f171edfb2f8b4e7d9 100644 Binary files a/zh-cn/application-dev/reference/arkui-js/figures/zh-cn_image_0000001167823326.gif and b/zh-cn/application-dev/reference/arkui-js/figures/zh-cn_image_0000001167823326.gif differ diff --git a/zh-cn/application-dev/reference/arkui-js/figures/zh-cn_image_0000001229677045.gif b/zh-cn/application-dev/reference/arkui-js/figures/zh-cn_image_0000001229677045.gif index 294687cdfb0cf7f2ea34f91c87d0a6394b32bff0..eaf9944676873d49c6ca1ac7110a48413583821c 100644 Binary files a/zh-cn/application-dev/reference/arkui-js/figures/zh-cn_image_0000001229677045.gif and b/zh-cn/application-dev/reference/arkui-js/figures/zh-cn_image_0000001229677045.gif differ diff --git a/zh-cn/application-dev/reference/arkui-js/js-components-common-methods.md b/zh-cn/application-dev/reference/arkui-js/js-components-common-methods.md index 3d7409df287240e3358c69d842b635dfad2346e1..fc4057a506525cbb98c611a973089923f306db93 100644 --- a/zh-cn/application-dev/reference/arkui-js/js-components-common-methods.md +++ b/zh-cn/application-dev/reference/arkui-js/js-components-common-methods.md @@ -138,52 +138,42 @@ button{ ```js // xxx.js -import promptAction from '@ohos.promptAction'; -export default{ - data:{ - animation:'', - }, - onInit(){ - }, - onShow(){ - var options = { - duration: 1500, - easing: 'friction', - delay: 500, - fill: 'forwards', - iterations: 2, - direction: 'normal', - }; - var frames = [ - {transform: {translate: '-120px -0px'}, opacity: 0.1, offset: 0.0}, - {transform: {translate: '120px 0px'}, opacity: 1.0, offset: 1.0} - ]; - this.animation = this.$element('idName').animate(frames, options); - // handle finish event - this.animation.onfinish = function(){ - promptAction.showToast({ - message: "The animation is finished." - }); - }; - // handle cancel event - this.animation.oncancel = function(){ - promptAction.showToast({ - message: "The animation is canceled." - }); - }; - // handle repeat event - this.animation.onrepeat = function(){ - promptAction.showToast({ - message: "The animation is repeated." - }); - }; - }, - start(){ - this.animation.play(); - }, - cancel(){ - this.animation.cancel(); - } +export default { + data: { + animation: '', + options: {}, + frames: {} + }, + onInit() { + this.options = { + duration: 1500, + easing: 'friction', + delay: 500, + fill: 'forwards', + iterations: 2, + direction: 'normal', + }; + this.frames = [ + { + transform: { + translate: '-120px -0px' + }, opacity: 0.1, offset: 0.0 + }, + { + transform: { + translate: '120px 0px' + }, opacity: 1.0, offset: 1.0 + } + ]; + }, + + start() { + this.animation = this.$element('idName').animate(this.frames, this.options); + this.animation.play(); + }, + cancel() { + this.animation.cancel(); + } } ``` diff --git a/zh-cn/application-dev/reference/arkui-js/js-components-container-swiper.md b/zh-cn/application-dev/reference/arkui-js/js-components-container-swiper.md index c0db6e8c9ce3668558a09d4c6ffbc888d1b5d769..d01d5628e943b96315a417708508aac9087e061c 100644 --- a/zh-cn/application-dev/reference/arkui-js/js-components-container-swiper.md +++ b/zh-cn/application-dev/reference/arkui-js/js-components-container-swiper.md @@ -117,16 +117,19 @@ } .swiperContent1{ height: 100%; + width: 100%; justify-content: center; background-color: #007dff; } .swiperContent2{ height: 100%; + width: 100%; justify-content: center; background-color: #ff7500; } .swiperContent3{ height: 100%; + width: 100%; justify-content: center; background-color: #41ba41; } diff --git a/zh-cn/application-dev/reference/arkui-js/js-components-svg-animate.md b/zh-cn/application-dev/reference/arkui-js/js-components-svg-animate.md index 2e9f3063b51fe8bb7e97235f9503984ac6c11b1e..704cd76d5bcfd906b8ed6fe2d94c5d017316a890 100644 --- a/zh-cn/application-dev/reference/arkui-js/js-components-svg-animate.md +++ b/zh-cn/application-dev/reference/arkui-js/js-components-svg-animate.md @@ -75,7 +75,7 @@
- +
diff --git a/zh-cn/application-dev/reference/arkui-ts/figures/borderImageGradient.png b/zh-cn/application-dev/reference/arkui-ts/figures/borderImageGradient.png index edf91d4844deeee4f997f65d2d88b45bf7ff7f1d..0cf19ef4273d18c84b86582543129906e8720142 100644 Binary files a/zh-cn/application-dev/reference/arkui-ts/figures/borderImageGradient.png and b/zh-cn/application-dev/reference/arkui-ts/figures/borderImageGradient.png differ diff --git a/zh-cn/application-dev/reference/arkui-ts/figures/waterflow.gif b/zh-cn/application-dev/reference/arkui-ts/figures/waterflow.gif new file mode 100644 index 0000000000000000000000000000000000000000..8c4010c17b302a8617508bbeb037a0dddf220882 Binary files /dev/null and b/zh-cn/application-dev/reference/arkui-ts/figures/waterflow.gif differ diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md index 2856ea7dd00b07f36b009b66db67ec7642084244..a55b5cded42631d0aaf4980b8e735153d5e08edb 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md @@ -100,21 +100,21 @@ struct ImageExample1 { Text('default').fontSize(16).fontColor(0xcccccc).height(30) Row({ space: 5 }) { Image($r('app.media.ic_png')) - .width(110).height(110).border({ width: 1 }).borderStyle(BorderStyle.Dashed) + .width(110).height(110).border({ width: 1 }) .overlay('png', { align: Alignment.Bottom, offset: { x: 0, y: 20 } }) Image($r('app.media.ic_gif')) - .width(110).height(110).border({ width: 1 }).borderStyle(BorderStyle.Dashed) + .width(110).height(110).border({ width: 1 }) .overlay('gif', { align: Alignment.Bottom, offset: { x: 0, y: 20 } }) Image($r('app.media.ic_svg')) - .width(110).height(110).border({ width: 1 }).borderStyle(BorderStyle.Dashed) + .width(110).height(110).border({ width: 1 }) .overlay('svg', { align: Alignment.Bottom, offset: { x: 0, y: 20 } }) } Row({ space: 5 }) { Image($r('app.media.img_example')) - .width(110).height(110).border({ width: 1 }).borderStyle(BorderStyle.Dashed) + .width(110).height(110).border({ width: 1 }) .overlay('jpg', { align: Alignment.Bottom, offset: { x: 0, y: 20 } }) Image(this.src) - .width(110).height(110).border({ width: 1 }).borderStyle(BorderStyle.Dashed) + .width(110).height(110).border({ width: 1 }) .overlay('network', { align: Alignment.Bottom, offset: { x: 0, y: 20 } }) }.margin({ top: 25, bottom: 10 }) } @@ -123,25 +123,25 @@ struct ImageExample1 { Text('objectFit').fontSize(16).fontColor(0xcccccc).height(30) Row({ space: 5 }) { Image($r('app.media.img_example')) - .border({ width: 1 }).borderStyle(BorderStyle.Dashed) + .border({ width: 1 }) .objectFit(ImageFit.None).width(110).height(110) .overlay('None', { align: Alignment.Bottom, offset: { x: 0, y: 20 } }) Image($r('app.media.img_example')) - .border({ width: 1 }).borderStyle(BorderStyle.Dashed) + .border({ width: 1 }) .objectFit(ImageFit.Fill).width(110).height(110) .overlay('Fill', { align: Alignment.Bottom, offset: { x: 0, y: 20 } }) Image($r('app.media.img_example')) - .border({ width: 1 }).borderStyle(BorderStyle.Dashed) + .border({ width: 1 }) .objectFit(ImageFit.Cover).width(110).height(110) .overlay('Cover', { align: Alignment.Bottom, offset: { x: 0, y: 20 } }) } Row({ space: 5 }) { Image($r('app.media.img_example_w250')) - .border({ width: 1 }).borderStyle(BorderStyle.Dashed) + .border({ width: 1 }) .objectFit(ImageFit.Contain).width(110).height(110) .overlay('Contain', { align: Alignment.Bottom, offset: { x: 0, y: 20 } }) Image($r('app.media.img_example_w250')) - .border({ width: 1 }).borderStyle(BorderStyle.Dashed) + .border({ width: 1 }) .objectFit(ImageFit.ScaleDown).width(110).height(110) .overlay('ScaleDown', { align: Alignment.Bottom, offset: { x: 0, y: 20 } }) }.margin({ top: 25 }) @@ -232,18 +232,18 @@ struct ImageExample2 { Row({ space: 50 }) { Image($r('app.media.img_example')) .renderMode(ImageRenderMode.Original).width(100).height(100) - .border({ width: 1 }).borderStyle(BorderStyle.Dashed) + .border({ width: 1 }) .overlay('Original', { align: Alignment.Bottom, offset: { x: 0, y: 20 } }) Image($r('app.media.img_example')) .renderMode(ImageRenderMode.Template).width(100).height(100) - .border({ width: 1 }).borderStyle(BorderStyle.Dashed) + .border({ width: 1 }) .overlay('Template', { align: Alignment.Bottom, offset: { x: 0, y: 20 } }) } Text('alt').fontSize(12).fontColor(0xcccccc).width('96%').height(30) Image('') .alt($r('app.media.Image_none')) - .width(100).height(100).border({ width: 1 }).borderStyle(BorderStyle.Dashed) + .width(100).height(100).border({ width: 1 }) Text('sourceSize').fontSize(12).fontColor(0xcccccc).width('96%') Row({ space: 50 }) { @@ -253,7 +253,7 @@ struct ImageExample2 { height: 150 }) .objectFit(ImageFit.ScaleDown).width('25%').aspectRatio(1) - .border({ width: 1 }).borderStyle(BorderStyle.Dashed) + .border({ width: 1 }) .overlay('w:150 h:150', { align: Alignment.Bottom, offset: { x: 0, y: 20 } }) Image($r('app.media.img_example')) .sourceSize({ @@ -261,22 +261,22 @@ struct ImageExample2 { height: 200 }) .objectFit(ImageFit.ScaleDown).width('25%').aspectRatio(1) - .border({ width: 1 }).borderStyle(BorderStyle.Dashed) + .border({ width: 1 }) .overlay('w:200 h:200', { align: Alignment.Bottom, offset: { x: 0, y: 20 } }) } Text('objectRepeat').fontSize(12).fontColor(0xcccccc).width('96%').height(30) Row({ space: 5 }) { Image($r('app.media.ic_health_heart')) - .width(120).height(125).border({ width: 1 }).borderStyle(BorderStyle.Dashed) + .width(120).height(125).border({ width: 1 }) .objectRepeat(ImageRepeat.XY).objectFit(ImageFit.ScaleDown) .overlay('ImageRepeat.XY', { align: Alignment.Bottom, offset: { x: 0, y: 20 } }) Image($r('app.media.ic_health_heart')) - .width(110).height(125).border({ width: 1 }).borderStyle(BorderStyle.Dashed) + .width(110).height(125).border({ width: 1 }) .objectRepeat(ImageRepeat.Y).objectFit(ImageFit.ScaleDown) .overlay('ImageRepeat.Y', { align: Alignment.Bottom, offset: { x: 0, y: 20 } }) Image($r('app.media.ic_health_heart')) - .width(110).height(125).border({ width: 1 }).borderStyle(BorderStyle.Dashed) + .width(110).height(125).border({ width: 1 }) .objectRepeat(ImageRepeat.X).objectFit(ImageFit.ScaleDown) .overlay('ImageRepeat.X', { align: Alignment.Bottom, offset: { x: 0, y: 20 } }) } diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-flowitem.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-flowitem.md new file mode 100644 index 0000000000000000000000000000000000000000..4628ea7bb51de907d3b1ace994e25c80d1e100b3 --- /dev/null +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-flowitem.md @@ -0,0 +1,31 @@ +# FlowItem + + +[瀑布流组件](ts-container-waterflow.md)的子组件,用来展示瀑布流具体item。 + + +> **说明:** +> +> 该组件从API Version 9开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 + + +## 子组件 + + +支持单个子组件。 + + +## 接口 + +FlowItem() + +使用该接口来创建瀑布流子组件。 + + +## 属性 + +无 + +## 示例 + +详见[瀑布流组件示例](ts-container-waterflow.md#示例)。 \ No newline at end of file diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-waterflow.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-waterflow.md new file mode 100644 index 0000000000000000000000000000000000000000..cba3fda2ef1385d851b80935f6b4406aba972f04 --- /dev/null +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-waterflow.md @@ -0,0 +1,291 @@ +# WaterFlow + + +瀑布流容器,由“行”和“列”分割的单元格所组成,通过容器自身的排列规则,将不同大小的“项目”自上而下,如瀑布般紧密布局。 + + +> **说明:** +> +> 该组件从API Version 9 开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 + + +## 子组件 + + +包含[FlowItem](ts-container-flowitem.md)子组件。 + + +## 接口 + + +WaterFlow(options?: {footer?: CustomBuilder, scroller?: Scroller}) + +**参数:** + +| 参数名 | 参数类型 | 必填 | 参数描述 | +| ---------- | ----------------------------------------------- | ------ | -------------------------------------------- | +| footer | [CustomBuilder](ts-types.md#custombuilder8) | 否 | 设置WaterFlow尾部组件。 | +| scroller | [Scroller](ts-container-scroll.md#scroller) | 否 | 可滚动组件的控制器,与可滚动组件绑定。
目前瀑布流仅支持Scroller组件的scrollToIndex接口。 | + + +## 属性 + + +除支持[通用属性](ts-universal-attributes-size.md)外,还支持以下属性: + +| 名称 | 参数类型 | 描述 | +| -------- | -------- | -------- | +| columnsTemplate | string | 设置当前瀑布流组件布局列的数量,不设置时默认1列。
例如, '1fr 1fr 2fr' 是将父组件分3列,将父组件允许的宽分为4等份,第一列占1份,第二列占1份,第三列占2份。并支持[auto-fill](#auto-fill说明)。
默认值:'1fr' | +| rowsTemplate | string | 设置当前瀑布流组件布局行的数量,不设置时默认1行。
例如, '1fr 1fr 2fr'是将父组件分三行,将父组件允许的高分为4等份,第一行占1份,第二行占一份,第三行占2份。并支持[auto-fill](#auto-fill说明)。
默认值:'1fr' | +| itemConstraintSize | [ConstraintSizeOptions](ts-types.md#constraintsizeoptions) | 设置约束尺寸,子组件布局时,进行尺寸范围限制。 | +| columnsGap | Length |设置列与列的间距。
默认值:0| +| rowsGap | Length |设置行与行的间距。
默认值:0| +| layoutDirection | [FlexDirection](ts-appendix-enums.md#flexdirection) |设置布局的主轴方向。
默认值:FlexDirection.Column| + +layoutDirection优先级高于rowsTemplate和columnsTemplate。根据layoutDirection设置情况,分为以下三种设置模式: + +- layoutDirection设置纵向布局(FlexDirection.Column 或 FlexDirection.ColumnReverse) + + 此时columnsTemplate有效(如果未设置,取默认值)。例如columnsTemplate设置为"1fr 1fr"、rowsTemplate设置为"1fr 1fr 1fr"时,瀑布流组件纵向布局,辅轴均分成横向2列。 + +- layoutDirection设置横向布局(FlexDirection.Row 或 FlexDirection.RowReverse) + + 此时rowsTemplate有效(如果未设置,取默认值)。例如columnsTemplate设置为"1fr 1fr"、rowsTemplate设置为"1fr 1fr 1fr"时,瀑布流组件横向布局,辅轴均分成纵向3列。 + +- layoutDirection未设置布局方向 + + 布局方向为layoutDirection的默认值:FlexDirection.Column,此时columnsTemplate有效。例如columnsTemplate设置为"1fr 1fr"、rowsTemplate设置为"1fr 1fr 1fr"时,瀑布流组件纵向布局,辅轴均分成横向2列。 + +## 事件 + + +除支持[通用事件](ts-universal-events-click.md)外,还支持以下事件: + + +| 名称 | 功能描述 | +| -------- | -------- | +| onReachStart(event: () => void) | 瀑布流组件到达起始位置时触发。 | +| onReachEnd(event: () => void) | 瀑布流组件到底末尾位置时触发。 | + + +## auto-fill说明 + +WaterFlow的columnsTemplate、rowsTemplate属性的auto-fill仅支持以下格式: + +```css +repeat(auto-fill, track-size) +``` + +其中repeat、auto-fill为关键字。track-size为行高或者列宽,支持的单位包括px、vp、%或有效数字,track-size至少包括一个有效行高或者列宽。 + + +## 示例 + + +```ts +// WaterFlowDataSource.ets + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 100; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): any { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdded(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChanged(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDeleted(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMoved(from, to) + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public Add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public AddLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length-1) + } + + // 在指定索引位置增加一个元素 + public AddItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public Delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public Delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public DeleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 重新加载数据 + public Reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} +``` + +```ts +// WaterflowDemo.ets +import { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct WaterflowDemo { + @State minSize: number = 50 + @State maxSize: number = 100 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + datasource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + // 计算flow item宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 保存flow item宽/高 + getItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.getItemSizeArray() + } + + @Builder itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow({ footer: this.itemFoot, scroller: this.scroller }) { + LazyForEach(this.datasource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + } + } + .width(this.itemWidthArray[item]) + .height(this.itemHeightArray[item]) + .backgroundColor(this.colors[item % 5]) + }, item => item) + } + .columnsTemplate("1fr 1fr 1fr 1fr") + .itemConstraintSize({ + minWidth: 0, + maxWidth: '100%', + minHeight: 0, + maxHeight: '100%' + }) + .columnsGap(10) + .rowsGap(5) + .onReachStart(() => { + console.info("onReachStart") + }) + .onReachEnd(() => { + console.info("onReachEnd") + }) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('80%') + .layoutDirection(FlexDirection.Column) + } + } +} +``` + +![zh-cn_image_WaterFlow.gif](figures/waterflow.gif) diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-polygon.md b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-polygon.md index 5ec83e3c362a6b4b9038e353633f9018c256af46..687754f921ef7200cbeb8f13d8a150dd4e0af4a6 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-polygon.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-polygon.md @@ -65,6 +65,7 @@ struct PolygonExample { Polygon({ width: 100, height: 100 }) .points([[0, 0], [50, 100], [100, 0]]) .fill(Color.Green) + .stroke(Color.Transparent) // 在 100 * 100 的矩形框中绘制一个四边形,起点(0, 0),经过(0, 100)和(100, 100),终点(100, 0) Polygon().width(100).height(100) .points([[0, 0], [0, 100], [100, 100], [100, 0]]) @@ -76,6 +77,7 @@ struct PolygonExample { .points([[50, 0], [0, 50], [20, 100], [80, 100], [100, 50]]) .fill(Color.Red) .fillOpacity(0.6) + .stroke(Color.Transparent) }.width('100%').margin({ top: 10 }) } } diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-rect.md b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-rect.md index d455b7d6be8fb885fb29d23d369a25274cd44481..dbddfaf03fa31c54f880521a47d37a1c56f423c7 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-rect.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-drawing-components-rect.md @@ -66,6 +66,7 @@ struct RectExample { // 绘制90% * 50矩形 Rect({ width: '90%', height: 50 }) .fill(Color.Pink) + .stroke(Color.Transparent) // 绘制90% * 50的矩形框 Rect() .width('90%') @@ -80,15 +81,18 @@ struct RectExample { .radiusHeight(20) .radiusWidth(40) .fill(Color.Pink) + .stroke(Color.Transparent) // 绘制90% * 80的矩形, 圆角宽高为20 Rect({ width: '90%', height: 80 }) .radius(20) .fill(Color.Pink) + .stroke(Color.Transparent) }.width('100%').margin({ top: 10 }) // 绘制90% * 50矩形, 左上圆角宽高40,右上圆角宽高20,右下圆角宽高40,左下圆角宽高20 Rect({ width: '90%', height: 80 }) .radius([[40, 40], [20, 20], [40, 40], [20, 20]]) .fill(Color.Pink) + .stroke(Color.Transparent) }.width('100%').margin({ top: 5 }) } } diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-border-image.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-border-image.md index 4456cfc244f8a907d3e2f306e935dd840d28d08d..2ce59a0349c7729a2e8c86b4913906f0ab5adb4f 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-border-image.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-border-image.md @@ -45,7 +45,7 @@ struct Index { build() { Row() { Column() { - Text('This is gradient color.').textAlign(TextAlign.Center).width(68) + Text('This is gradient color.').textAlign(TextAlign.Center).height(50).width(200) .borderImage({ source: { angle: 90, diff --git a/zh-cn/application-dev/ui/figures/zh-cn_image_0000001163531210.gif b/zh-cn/application-dev/ui/figures/zh-cn_image_0000001163531210.gif index 8d5a07d1ff67011de5d0ec6bc0c2e552db9e5cd0..47730f745cfd341cd6f11c9a3d4ce71d4b2795fb 100644 Binary files a/zh-cn/application-dev/ui/figures/zh-cn_image_0000001163531210.gif and b/zh-cn/application-dev/ui/figures/zh-cn_image_0000001163531210.gif differ diff --git a/zh-cn/application-dev/ui/figures/zh-cn_image_0000001189089950.gif b/zh-cn/application-dev/ui/figures/zh-cn_image_0000001189089950.gif index eb0c760faaf917a6935af461e0094fd8e7b8e85b..903db10d6d7916f42ae2100403e02da2b2cf0fa2 100644 Binary files a/zh-cn/application-dev/ui/figures/zh-cn_image_0000001189089950.gif and b/zh-cn/application-dev/ui/figures/zh-cn_image_0000001189089950.gif differ diff --git a/zh-cn/application-dev/ui/figures/zh-cn_image_0000001234011019.gif b/zh-cn/application-dev/ui/figures/zh-cn_image_0000001234011019.gif index 24f00c9f1aa6ec431a355f5dd2d88b920607cd05..ab13d6f819a666ded9ffffac99168beafacd97ae 100644 Binary files a/zh-cn/application-dev/ui/figures/zh-cn_image_0000001234011019.gif and b/zh-cn/application-dev/ui/figures/zh-cn_image_0000001234011019.gif differ diff --git a/zh-cn/application-dev/ui/figures/zh-cn_image_0000001234130975.png b/zh-cn/application-dev/ui/figures/zh-cn_image_0000001234130975.png index 21d56ef14b92d136e304c4bae6ab8b1f447557bb..6b9e3cb7527e8f1415fd2d32cbc3cb5e12edb241 100644 Binary files a/zh-cn/application-dev/ui/figures/zh-cn_image_0000001234130975.png and b/zh-cn/application-dev/ui/figures/zh-cn_image_0000001234130975.png differ diff --git a/zh-cn/application-dev/ui/figures/zh-cn_image_0000001234289455.gif b/zh-cn/application-dev/ui/figures/zh-cn_image_0000001234289455.gif index a6296483cbe2994e36e97d422588f3a9156b56eb..960772dc9536a9e103125503bbb7d4723a6f8c49 100644 Binary files a/zh-cn/application-dev/ui/figures/zh-cn_image_0000001234289455.gif and b/zh-cn/application-dev/ui/figures/zh-cn_image_0000001234289455.gif differ diff --git a/zh-cn/application-dev/ui/ui-js-components-stepper.md b/zh-cn/application-dev/ui/ui-js-components-stepper.md index d91733753be4d725b8df526df0bb9bf3fb8a821b..bc2fbb91c69af6215bbe86cdaced35b78190e631 100644 --- a/zh-cn/application-dev/ui/ui-js-components-stepper.md +++ b/zh-cn/application-dev/ui/ui-js-components-stepper.md @@ -186,7 +186,7 @@ text{ } ``` -![zh-cn_image_0000001234130975](figures/zh-cn_image_0000001234130975.png) +![zh-cn_image_0000001234130975](figures/zh-cn_image_0000001234130975.PNG) ## 添加事件