diff --git a/zh-cn/application-dev/reference/arkui-js/js-components-canvas-canvasrenderingcontext2d.md b/zh-cn/application-dev/reference/arkui-js/js-components-canvas-canvasrenderingcontext2d.md index be29b6d2c188431ecc74b254a745882553b282b8..a6012798b6247535d90bfa64c7df361446a9b240 100644 --- a/zh-cn/application-dev/reference/arkui-js/js-components-canvas-canvasrenderingcontext2d.md +++ b/zh-cn/application-dev/reference/arkui-js/js-components-canvas-canvasrenderingcontext2d.md @@ -12,7 +12,8 @@
- <input type="button" style="width: 180px; height: 60px;" value="fillStyle" onclick="antialias" />
+ + ``` ``` @@ -27,9 +28,14 @@ }, antialias() { const el = this.$refs.canvas1; - const ctx = el.getContext('2d', { antialias: true }); ctx.beginPath(); ctx.arc(100, 75, 50, 0, 6.28); ctx.stroke(); }} + const ctx = el.getContext('2d', { antialias: true }); + ctx.beginPath(); ] + ctx.arc(100, 75, 50, 0, 6.28); + ctx.stroke(); + } + } ``` - + - 示意图(关闭抗锯齿) ![zh-cn_image_0000001214837333](figures/zh-cn_image_0000001214837333.png) @@ -62,12 +68,13 @@ ### fillStyle -``` + ``` +
-``` + ``` ``` //xxx.js @@ -103,6 +110,7 @@ export default { ctx.strokeRect(25, 25, 85, 105); } } + ``` ![zh-cn_image_0000001166484430](figures/zh-cn_image_0000001166484430.png) @@ -260,22 +268,21 @@ export default { ctx.moveTo(140, 10); ctx.lineTo(140, 160); ctx.stroke(); - - ctx.font = '18px sans-serif'; - - // Show the different textAlign values - ctx.textAlign = 'start'; - ctx.fillText('textAlign=start', 140, 60); - ctx.textAlign = 'end'; - ctx.fillText('textAlign=end', 140, 80); - ctx.textAlign = 'left'; + ctx.font = '18px sans-serif'; + // Show the different textAlign values + ctx.textAlign = 'start'; + ctx.fillText('textAlign=start', 140, 60); + ctx.textAlign = 'end'; + ctx.fillText('textAlign=end', 140, 80); + ctx.textAlign = 'left'; ctx.fillText('textAlign=left', 140, 100); - ctx.textAlign = 'center'; - ctx.fillText('textAlign=center',140, 120); - ctx.textAlign = 'right'; + ctx.textAlign = 'center'; + ctx.fillText('textAlign=center',140, 120); + ctx.textAlign = 'right'; ctx.fillText('textAlign=right',140, 140); } } + ``` @@ -300,9 +307,7 @@ export default { ctx.moveTo(0, 120); ctx.lineTo(400, 120); ctx.stroke(); - ctx.font = '20px sans-serif'; - ctx.textBaseline = 'top'; ctx.fillText('Top', 10, 120); ctx.textBaseline = 'bottom'; @@ -339,7 +344,7 @@ export default { ctx.globalAlpha = 0.4; ctx.fillStyle = 'rgb(0,0,255)'; ctx.fillRect(50, 50, 50, 50); - + } } ``` @@ -389,12 +394,12 @@ export default { | xor | 使用异或操作对新绘制内容与现有绘制内容进行融合。 | - 示例 - ``` +```
- ``` +``` ``` //xxx.js @@ -423,12 +428,12 @@ export default { ### shadowBlur -``` + ```
-``` + ``` ``` //xxx.js @@ -571,12 +576,12 @@ fillRect(x: number, y: number, width:number, height: number): void | height | number | 指定矩形的高度。 | - 示例 - ``` +```
- ``` +``` ``` //xxx.js @@ -1740,8 +1745,8 @@ createImageData(width: number, height: number, imageData: Object): Object onShow() { const el =this.$refs.canvas; const ctx = el.getContext('2d'); - imageData = ctx.createImageData(50, 100); // Create ImageData with 50px width and 100px height - newImageData = ctx.createImageData(imageData); // Create ImageData using the input imageData + var imageData = ctx.createImageData(50, 100); // Create ImageData with 50px width and 100px height + var newImageData = ctx.createImageData(imageData); // Create ImageData using the input imageData } } ``` @@ -1777,8 +1782,8 @@ getImageData(sx: number, sy: number, sw: number, sh: number): Object //xxx.js export default { onShow() { - var test = this.$element('getImageData') - var ctx = test.getContext('2d'); + const test = this.$element('getImageData') + const ctx = test.getContext('2d'); var imageData = ctx.getImageData(0, 0, 280, 300); } } @@ -1813,8 +1818,8 @@ putImageData(imageData: Object, dx: number, dy: number, dirtyX: number, dirtyY: //xxx.js export default { onShow() { - var test = this.$element('getImageData') - var ctx = test.getContext('2d'); + const test = this.$element('getImageData') + const ctx = test.getContext('2d'); var imgData = ctx.createImageData(100, 100); for (var i = 0; i < imgData.data.length; i += 4) { imgData.data[i + 0] = 255; @@ -1922,7 +1927,7 @@ transferFromImageBitmap(bitmap: ImageBitmap): void var offscreen = new OffscreenCanvas(500,500); var offscreenCanvasCtx = offscreen.getContext("2d"); offscreenCanvasCtx.fillRect(0, 0, 200, 200); - + var bitmap = offscreen.transferToImageBitmap(); canvas.transferFromImageBitmap(bitmap); } @@ -1930,3 +1935,7 @@ transferFromImageBitmap(bitmap: ImageBitmap): void ``` ![zh-cn_image_0000001168984882](figures/zh-cn_image_0000001168984882.png) + + ``` + + ``` \ No newline at end of file diff --git a/zh-cn/application-dev/ui/figures/zh-cn_image_tab.gif b/zh-cn/application-dev/ui/figures/zh-cn_image_tab.gif new file mode 100644 index 0000000000000000000000000000000000000000..fde104516f23c4dcc56b3c9f54334d7ee40925a6 Binary files /dev/null and b/zh-cn/application-dev/ui/figures/zh-cn_image_tab.gif differ diff --git a/zh-cn/application-dev/ui/ui-js-animate-component.md b/zh-cn/application-dev/ui/ui-js-animate-component.md index 674d3c3b9c5aea8f80b913189dce383836805dbe..91baf79e1993a469e46f03560e64d79e3c14e0ae 100644 --- a/zh-cn/application-dev/ui/ui-js-animate-component.md +++ b/zh-cn/application-dev/ui/ui-js-animate-component.md @@ -104,7 +104,30 @@ export default { this.options = { duration: 4000, }; - this.keyframes = [ { transform: { translate: '-120px -0px', scale: 1, rotate: 0 }, transformOrigin: '100px 100px', offset: 0.0, width: 200, height: 200 }, { transform: { translate: '120px 0px', scale: 1.5, rotate: 90 }, transformOrigin: '100px 100px', offset: 1.0, width: 300, height: 300 } ]; + this.keyframes = [ + { + transform: { + translate: '-120px -0px', + scale: 1, + rotate: 0 + }, + transformOrigin: '100px 100px', + offset: 0.0, + width: 200, + height: 200 + }, + { + transform: { + translate: '120px 0px', + scale: 1.5, + rotate: 90 + }, + transformOrigin: '100px 100px', + offset: 1.0, + width: 300, + height: 300 + } + ]; }, Show() { this.animation = this.$element('content').animate(this.keyframes, this.options); diff --git a/zh-cn/application-dev/ui/ui-js-animate-dynamic-effects.md b/zh-cn/application-dev/ui/ui-js-animate-dynamic-effects.md index b4d2bf487d7fd39890b98e6311b2bf9bfbfc58c2..b5b8a275fc48d3b404b54a1acffdb4edd4751bf2 100644 --- a/zh-cn/application-dev/ui/ui-js-animate-dynamic-effects.md +++ b/zh-cn/application-dev/ui/ui-js-animate-dynamic-effects.md @@ -25,6 +25,8 @@ ``` /* xxx.css */ .container { + width:100%; + height:100%; flex-direction: column; align-items: center; justify-content: center; @@ -90,7 +92,7 @@ animator支持事件和接口,可以通过添加frame、cancel、repeat、fini ``` -
+
-
+
this is a dialog
@@ -20,6 +20,8 @@ Dialog组件用于创建自定义弹窗,通常用来展示用户当前需要 ``` /* xxx.css */ .doc-page { + width:100%; + height:100%; flex-direction: column; align-items: center; justify-content: center; @@ -83,6 +85,8 @@ export default { ``` /* xxx.css */ .doc-page { + width:100%; + height:100%; flex-direction: column; align-items: center; justify-content: center; diff --git a/zh-cn/application-dev/ui/ui-js-components-form.md b/zh-cn/application-dev/ui/ui-js-components-form.md index 6c84b6395881489bb419cd9d057628315f7a5234..43eb0538f1c58edbbbb3c5ab5e1a7acaaff4f69b 100644 --- a/zh-cn/application-dev/ui/ui-js-components-form.md +++ b/zh-cn/application-dev/ui/ui-js-components-form.md @@ -13,7 +13,8 @@ Form是一个表单容器,支持容器内[Input](../reference/arkui-js/js-comp ```
-
+ +
``` @@ -21,6 +22,8 @@ Form是一个表单容器,支持容器内[Input](../reference/arkui-js/js-comp ``` /* xxx.css */ .container { + width:100%; + height:100%; flex-direction: column; justify-content: center; align-items: center; @@ -59,9 +62,8 @@ Form是一个表单容器,支持容器内[Input](../reference/arkui-js/js-comp background-color: #F1F3F5; } .formClass{ - width: 80%; - padding: 10px; - border: 1px solid #c3d3e7; + width: 100%; + height: 20%; } ``` @@ -72,26 +74,46 @@ Form是一个表单容器,支持容器内[Input](../reference/arkui-js/js-comp ## 添加响应事件 为Form组件添加submit和reset事件,来提交表单内容或重置表单选项。 + ``` -
-
-
-
- - - - -
-
- - -
+
+ +
+ + + + +
+
+ + + +
``` +``` +/* index.css */ +.container{ + width: 100%; + height: 100%; + flex-direction: column; + justify-items: center + align-items: center; + background-color: #F1F3F5; +} +.form{ + width: 100%; + height: 30%; + flex-direction: column; + justify-items: center + align-items: center; +} +``` + ``` /* xxx.js */ import prompt from '@system.prompt'; diff --git a/zh-cn/application-dev/ui/ui-js-components-images.md b/zh-cn/application-dev/ui/ui-js-components-images.md index f6833719256cbaab51cf8ae84e9f58e351ca74df..10a8f05bdc30869c07d65f17f70cf0e4119379b3 100644 --- a/zh-cn/application-dev/ui/ui-js-components-images.md +++ b/zh-cn/application-dev/ui/ui-js-components-images.md @@ -9,13 +9,15 @@ Image是图片组件,用来渲染展示图片。具体用法请参考[Image AP ```
- +
``` ``` /* xxx.css */ .container { + width: 100%; + height: 100%; flex-direction: column; justify-content: center; align-items: center; @@ -45,15 +47,15 @@ Image是图片组件,用来渲染展示图片。具体用法请参考[Image AP flex-direction: column; align-items: center; justify-content: center; -background-color:#F1F3F5; + background-color:#F1F3F5; } image{ - width: 80%; height: 500px; + width: 80%; + height: 500px; border: 5px solid saddlebrown; border-radius: 20px; object-fit: contain; match-text-direction:true; - } ``` @@ -69,10 +71,13 @@ image{
- -
- image{{$idx}} - content +
+ + +
+ image{{$idx}} + content +
@@ -235,7 +240,10 @@ export default { justify-content: space-between; } .testimage { - width: 100%; height: 400px; object-fit: scale-down; border-radius: 20px;} + width: 100%; height: 400px; + object-fit: scale-down; + border-radius: 20px; +} ``` ``` diff --git a/zh-cn/application-dev/ui/ui-js-components-input.md b/zh-cn/application-dev/ui/ui-js-components-input.md index b37afa8a946c8886352ca77754c0ad1acc3f8cd8..b8afcf6a8a0939b862935e7aa17c8c71ed5e519d 100644 --- a/zh-cn/application-dev/ui/ui-js-components-input.md +++ b/zh-cn/application-dev/ui/ui-js-components-input.md @@ -17,6 +17,8 @@ Input是交互式组件,用于接收用户数据。其类型可设置为日期 ``` /* xxx.css */ .container { + width: 100%; + height: 100%; flex-direction: column; justify-content: center; align-items: center; @@ -54,6 +56,8 @@ Input是交互式组件,用于接收用户数据。其类型可设置为日期 ``` /* xxx.css */ .container { + width: 100%; + height: 100%; align-items: center; flex-direction: column; justify-content: center; @@ -120,6 +124,7 @@ export default { /* xxx.css */ .content { width: 100%; + height: 100%; flex-direction: column; align-items: center; justify-content: center; @@ -176,6 +181,7 @@ export default { /* xxx.css */ .content { width: 100%; + height: 100%; flex-direction: column; align-items: center; justify-content: center; diff --git a/zh-cn/application-dev/ui/ui-js-components-list.md b/zh-cn/application-dev/ui/ui-js-components-list.md index c0bc55579ab778df91329c6cfcc1ba586aba0f03..45287a52316872090ed15ddb4a53a14729a138af 100644 --- a/zh-cn/application-dev/ui/ui-js-components-list.md +++ b/zh-cn/application-dev/ui/ui-js-components-list.md @@ -10,7 +10,8 @@ List是用来显示列表的组件,包含一系列相同宽度的列表项, ```
- + + @@ -21,6 +22,8 @@ List是用来显示列表的组件,包含一系列相同宽度的列表项, ``` /* xxx.css */ .container { + width:100%; + height:100%; flex-direction: column; align-items: center; background-color: #F1F3F5; @@ -191,6 +194,7 @@ export default { ![zh-cn_image_0000001162911958](figures/zh-cn_image_0000001162911958.gif) > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** +> > - groupcollapse和groupexpand事件仅支持list-item-group组件使用。 diff --git a/zh-cn/application-dev/ui/ui-js-components-menu.md b/zh-cn/application-dev/ui/ui-js-components-menu.md index d364094b02bfbcfd9d5db511251e48bc0bf3b86d..0ea286c5d05009fa0c147059a3ae069a8e823d23 100644 --- a/zh-cn/application-dev/ui/ui-js-components-menu.md +++ b/zh-cn/application-dev/ui/ui-js-components-menu.md @@ -25,6 +25,8 @@ ``` /* xxx.css */ .container{ + width: 100%; + height: 100%; flex-direction: column; background-color: #F1F3F5; align-items: center; @@ -65,6 +67,8 @@ ``` /* xxx.css */ .container{ + width: 100%; + height: 100%; flex-direction: column; background-color: #F1F3F5; align-items: center; @@ -115,6 +119,8 @@ option{ ``` /* xxx.css */ .container{ + width: 100%; + height: 100%; flex-direction: column; background-color: #F1F3F5; width: 100%; @@ -254,7 +260,16 @@ export default { {name: "black", checked:false}, ], }, - toggleClick(index){ for(let i=0;i ``` - - ``` /* xxx.css */ .container { @@ -119,6 +117,8 @@ Slider组件通过color、selected-color、block-color样式分别为滑动条 ``` /* xxx.css */ .container { + width: 100%; + height: 100%; flex-direction: column; justify-content: center; align-items: center; 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 22479506c1f62bb740356386eaa4ef374e1ad704..15c8e42a4a754135e2b00941b493561c1add216a 100644 --- a/zh-cn/application-dev/ui/ui-js-components-stepper.md +++ b/zh-cn/application-dev/ui/ui-js-components-stepper.md @@ -14,7 +14,8 @@ ```
- + + Step 1 @@ -27,6 +28,8 @@ ``` /* xxx.css */ .container { + width:100%; + height:100%; flex-direction: column; justify-content: center; align-items: center; @@ -66,6 +69,8 @@ text{ ``` /* index.css */ .container { + width:100%; + height:100%; flex-direction: column; background-color:#F1F3F5; } @@ -102,7 +107,9 @@ text{ ``` /* index.css */ -.container { +.container { + width:100%; + height:100%; flex-direction: column; background-color:#F1F3F5; } @@ -154,6 +161,8 @@ Stepper组件默认填充父容器,通过border和background-color设置边框 ``` /* index.css */ .container { + width:100%; + height:100%; flex-direction: column; align-items: center; justify-content: center; @@ -208,6 +217,8 @@ Stepper分别添加finish,change,next,back,skip事件。 ``` /* xxx.css */ .doc-page { + width:100%; + height:100%; flex-direction: column; align-items: center; justify-content: center; @@ -325,6 +336,8 @@ export default { ``` /* xxx.css */ .container { + width:100%; + height:100%; flex-direction: column; align-items: center; justify-content: center; diff --git a/zh-cn/application-dev/ui/ui-js-components-swiper.md b/zh-cn/application-dev/ui/ui-js-components-swiper.md index de6c56907cf20ef9484c5101ffff11494f984909..de9f3aa008425bd06e50e3c7865e5a764aabb2f7 100644 --- a/zh-cn/application-dev/ui/ui-js-components-swiper.md +++ b/zh-cn/application-dev/ui/ui-js-components-swiper.md @@ -28,18 +28,24 @@ Swiper为滑动容器,提供切换显示子组件的能力。具体用法请 ``` /* xxx.css */ .container{ + width: 100%; + height: 100%; flex-direction: column; background-color: #F1F3F5; align-items: center; justify-content: center; width: 100%; } +swiper{ + height: 30%; +} .item{ width: 100%; height: 500px; } text{ width: 100%; + height: 100%; text-align: center; font-size: 50px; color: white; @@ -84,11 +90,15 @@ Swiper组件当不开启循环播放(loop="false")时添加自动播放属 ``` /* xxx.css */ .container{ + width: 100%; + height: 100%; flex-direction: column; background-color: #F1F3F5; align-items: center; justify-content: center; - width: 100%; +} +swiper{ + height: 30%; } .item{ width: 100%; @@ -96,6 +106,7 @@ Swiper组件当不开启循环播放(loop="false")时添加自动播放属 } text{ width: 100%; + height: 100%; text-align: center; font-size: 50px; color: white; @@ -138,11 +149,12 @@ text{ ``` /* xxx.css */ .container{ + width: 100%; + height: 100%; flex-direction: column; background-color: #F1F3F5; align-items: center; justify-content: center; - width: 100%; } swiper{ width: 500px; @@ -205,11 +217,15 @@ text{ ``` /* xxx.css */ .container{ + width: 100%; + height: 100%; flex-direction: column; background-color: #F1F3F5; align-items: center; justify-content: center; - width: 100%; +} +swiper{ + height: 30%; } .item{ width: 100%; @@ -217,6 +233,7 @@ text{ } text{ width: 100%; + height: 100%; text-align: center; font-size: 50px; color: white; diff --git a/zh-cn/application-dev/ui/ui-js-components-switch.md b/zh-cn/application-dev/ui/ui-js-components-switch.md index 4991f8587af2f5e0526245f7dc2b1171f4c50574..aa7e7e71cb4f1e7d7e9a1b850fa5cff7c533bc46 100644 --- a/zh-cn/application-dev/ui/ui-js-components-switch.md +++ b/zh-cn/application-dev/ui/ui-js-components-switch.md @@ -44,6 +44,8 @@ Switch为开关选择器,切换开启或关闭状态。具体用法请参考[S ``` /* xxx.css */ .container { + width: 100%; + height: 100%; display: flex; justify-content: center; align-items: center; @@ -53,7 +55,7 @@ switch{ // 选中时的字体颜色 texton-color: #002aff; // 未选中时的字体颜色 -textoff-color: silver; + textoff-color: silver; text-padding: 20px; font-size: 50px; } @@ -114,6 +116,8 @@ export default { ``` /* xxx.css */ .container { + width: 100%; + height: 100%; background-color: #F1F3F5; flex-direction: column; padding: 50px; diff --git a/zh-cn/application-dev/ui/ui-js-components-text.md b/zh-cn/application-dev/ui/ui-js-components-text.md index 96dfb5a196b80a0cf9f24d836bb71c8668159927..b6b79dffe348edec5ab3ff51f76aaf3dc1a52088 100644 --- a/zh-cn/application-dev/ui/ui-js-components-text.md +++ b/zh-cn/application-dev/ui/ui-js-components-text.md @@ -34,45 +34,41 @@ Text是文本组件,用于呈现一段文本信息。具体用法请参考[Tex - 添加文本样式 - 设置color、font-size、allow-scale、word-spacing、text-valign属性分别为文本添加颜色、大小、缩放、文本之间的间距和文本在垂直方向的对齐方式。 - - - ``` - -
- - This is a passage - - - This is a passage - -
- ``` - - - ``` - /* xxx.css */ - .container { - width: 100%; - height: 100%; - flex-direction: column; - align-items: center; - justify-content: center; - background-color: #F1F3F5; - } - ``` - - - ![zh-cn_image_0000001220778205](figures/zh-cn_image_0000001220778205.png) + 设置color、font-size、allow-scale、word-spacing、text-valign属性分别为文本添加颜色、大小、缩放、文本之间的间距和文本在垂直方向的对齐方式。 + +``` + +
+ + This is a passage + + + This is a passage + +
+``` + +``` +/* xxx.css */ +.container { + width: 100%; + height: 100%; + flex-direction: column; + align-items: center; + justify-content: center; + background-color: #F1F3F5; +} +``` + + + ![zh-cn_image_0000001220778205](figures/zh-cn_image_0000001220778205.png) - 添加划线 +​ 设置text-decoration和text-decoration-colo属性为文本添加划线和划线颜色,text-decoration枚举值请参考 Text自有样式。 + - 设置text-decoration和text-decoration-colo属性为文本添加划线和划线颜色,text-decoration枚举值请参考Text自有样式。 - - - ```
@@ -80,46 +76,38 @@ Text是文本组件,用于呈现一段文本信息。具体用法请参考[Tex This is a passage - +
- ``` - - - ``` - /* xxx.css */ - .container { - width: 100%; - height: 100%; - flex-direction: column; - align-items: center; - justify-content: center; - } - text{ - font-size: 50px; - } - ``` - - - ![zh-cn_image_0000001220856725](figures/zh-cn_image_0000001220856725.png) +``` +/* xxx.css */ +.container { + width: 100%; + height: 100%; + flex-direction: column; + align-items: center; + justify-content: center; +} +text{ + font-size: 50px; +} +``` + + ![zh-cn_image_0000001220856725](figures/zh-cn_image_0000001220856725.png) - 隐藏文本内容 + 当文本内容过多而显示不全时,添加text-overflow属性将隐藏内容以省略号的形式展现 + +``` + +
+ + This is a passage + +
+``` - 当文本内容过多而显示不全时,添加text-overflow属性将隐藏内容以省略号的形式展现。 - - - ``` - -
- - This is a passage - -
- ``` - - - ``` /* xxx.css */ .container { width: 100%; @@ -127,47 +115,42 @@ Text是文本组件,用于呈现一段文本信息。具体用法请参考[Tex flex-direction: column; align-items: center; background-color: #F1F3F5; - justify-content: center; + justify-content: center; } .text{ width: 200px; max-lines: 1; text-overflow:ellipsis; } - ``` - - - > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** - > - text-overflow样式需要与max-lines样式配套使用,设置了最大行数的情况下生效。 - > - > - max-lines属性设置文本最多可以展示的行数。 - - - ![zh-cn_image_0000001163656706](figures/zh-cn_image_0000001163656706.png) + + **说明:** + +- text-overflow样式需要与max-lines样式配套使用,设置了最大行数的情况下生效。 +- max-lines属性设置文本最多可以展示的行数。 + + +​ ![zh-cn_image_0000001163656706](figures/zh-cn_image_0000001163656706.png) - 设置文本折行 +​ 设置word-break属性对文本内容做断行处理,word-break枚举值请参考Text自有样式。 + +``` + +
+
+ + Welcome to the world + + + Welcome to the world + +
+
-
-
- - Welcome to the world - - - Welcome to the world - -
-
- ``` - - - ``` /* xxx.css */ .container { background-color: #F1F3F5; @@ -196,23 +179,25 @@ Text是文本组件,用于呈现一段文本信息。具体用法请参考[Tex word-break: break-all; font-size: 40px; } - ``` - - - ![zh-cn_image_0000001209033195](figures/zh-cn_image_0000001209033195.png) + + +​ ![zh-cn_image_0000001209033195](figures/zh-cn_image_0000001209033195.png) - Text组件支持[Span](../reference/arkui-js/js-components-basic-span.md)子组件 - + ``` -
+
This is a passage - This 1 is a 1 passage + This 1 + + is a 1 + passage
``` @@ -253,6 +238,8 @@ Text组件通过数据绑定展示文本内容,Span组件通过设置show属 ``` /* xxx.css */ .container { + width: 100%; + height: 100%; align-items: center; flex-direction: column; justify-content: center; diff --git a/zh-cn/application-dev/ui/ui-js-components-toolbar.md b/zh-cn/application-dev/ui/ui-js-components-toolbar.md index cfbe78bf94d912ae2fcac8ad8c3e7bf2cb593cc6..09f8c17ff06b5d686d2367da9eb3014b70bac79f 100644 --- a/zh-cn/application-dev/ui/ui-js-components-toolbar.md +++ b/zh-cn/application-dev/ui/ui-js-components-toolbar.md @@ -23,6 +23,8 @@ Toolbar为页面工具栏组件,用于展示针对当前界面的操作选项 ``` /* xxx.css */ .container { + width: 100%; + height: 100%; flex-direction: column; justify-content: center; align-items: center; @@ -44,7 +46,12 @@ toolbar-item{
- + + + + + +
``` @@ -53,6 +60,8 @@ toolbar-item{ ``` /* xxx.css */ .container { + width: 100%; + height: 100%; flex-direction: column; justify-content: center; align-items: center; @@ -92,6 +101,7 @@ toolbar-item{ background-color: #F1F3F5; flex-direction: column; width: 100%; + height: 100%; justify-content: center; align-items: center; } @@ -131,6 +141,7 @@ toolbar-item{ background-color: #F1F3F5; flex-direction: column; width: 100%; + height: 100%; justify-content: center; align-items: center; } diff --git a/zh-cn/application-dev/ui/ui-ts-layout-grid-container.md b/zh-cn/application-dev/ui/ui-ts-layout-grid-container.md index 23a040c5169edcdc73f6837dd9bbd89c39019d12..df9383f16bbd3f62f6de1e8dd6d148ca19d0dedc 100644 --- a/zh-cn/application-dev/ui/ui-ts-layout-grid-container.md +++ b/zh-cn/application-dev/ui/ui-ts-layout-grid-container.md @@ -108,8 +108,8 @@ GridContainer() { struct GridContainerExample { build() { Column({ space: 5 }) { - GridContainer({ columns: 6, sizeType: SizeType.Auto, gutter: 10, margin: 20 }) { - Row() { + GridContainer({ columns: 6 }) { + Flex({justifyContent:FlexAlign.SpaceAround}) { Text('1') .useSizeType({ xs: { span: 2, offset: 0 }, @@ -120,18 +120,18 @@ struct GridContainerExample { .height(100).backgroundColor(0x4682B4).textAlign(TextAlign.Center) Text('2') .useSizeType({ - xs: { span: 2, offset: 2 }, - sm: { span: 2, offset: 2 }, - md: { span: 4, offset: 1 }, - lg: { span: 4, offset: 1 }, + xs: { span: 2, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 4, offset: 0 }, + lg: { span: 4, offset: 0 }, }) .height(100).backgroundColor(0x46F2B4).textAlign(TextAlign.Center) Text('3') .useSizeType({ - xs: { span: 2, offset: 4 }, - sm: { span: 2, offset: 4 }, - md: { span: 1, offset: 5 }, - lg: { span: 1, offset: 5 }, + xs: { span: 2, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 1, offset: 0 }, + lg: { span: 1, offset: 0 }, }) .height(100).backgroundColor(0x46A2B4).textAlign(TextAlign.Center) }