From e3d023c7b19361111edc09dac7e655b6df2e9d4f Mon Sep 17 00:00:00 2001 From: "ester.zhou" Date: Wed, 30 Mar 2022 18:08:45 +0800 Subject: [PATCH] update doc Signed-off-by: ester.zhou --- .../ui/ui-ts-creating-simple-page.md | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/en/application-dev/ui/ui-ts-creating-simple-page.md b/en/application-dev/ui/ui-ts-creating-simple-page.md index c4edd001c5..fae630d83e 100644 --- a/en/application-dev/ui/ui-ts-creating-simple-page.md +++ b/en/application-dev/ui/ui-ts-creating-simple-page.md @@ -26,7 +26,7 @@ In this section, we will develop an infographic food details page, by building c ![en-us_image_0000001222967780](figures/en-us_image_0000001222967780.png) 2. Display food pictures. - Create an <Image> component and specify a URL for it. The <Image> and <Text> components are mandatory. To display the <Text> component above the <Image> component, you need to declare the <Image> component first. Image resources are stored in the rawfile folder in resources. When referencing the resources in the rawfile folder, use the $rawfile('_filename_ loaded) format, where filename indicates the relative path of the file in the rawfile folder. Currently, $rawfile only allows the <Image> component to reference image resources. + Create an <Image> component and specify a URL for it. The <Image> and <Text> components are mandatory. To display the <Text> component above the <Image> component, you need to declare the <Image> component first. Image resources are stored in the rawfile folder in resources. When referencing the resources in the rawfile folder, use the \```"$rawfile('filename')"``` format, where filename indicates the relative path of the file in the rawfile folder. Currently, $rawfile only allows the <Image> component to reference image resources. ``` @Entry @@ -54,7 +54,7 @@ In this section, we will develop an infographic food details page, by building c ![en-us_image_0000001222807784](figures/en-us_image_0000001222807784.png) - You can then can reference the application resource in the $r('app.type.name') format, that is, $r('app.media.Tomato'). + You can then can reference the application resource in the \``` "$r('app.type.name') "\``` format, that is, $r('app.media.Tomato'). ``` @@ -76,11 +76,12 @@ In this section, we will develop an infographic food details page, by building c 4. Set the width and height of the image, and set the objectFit attribute of the image to ImageFit.Contain, which means to keep the aspect ratio of the image to ensure that the image is completely displayed within the boundary. If the image fills the entire screen, the possible causes are as follows: + 1. The width and height of the image are not set. - 2. The default attribute of objectFit of the image is ImageFit.Cover, that is, the image is zoomed in or zoomed out to fill the entire display boundary with the aspect ratio locked. - - +2. The default attribute of objectFit of the image is ImageFit.Cover, that is, the image is zoomed in or zoomed out to fill the entire display boundary with the aspect ratio locked. + + ``` @Entry @Component @@ -96,10 +97,10 @@ In this section, we will develop an infographic food details page, by building c } } } - ``` - - ![en-us_image_0000001223127732](figures/en-us_image_0000001223127732.png) - +``` + +![en-us_image_0000001223127732](figures/en-us_image_0000001223127732.png) + 5. Set the food image and name layout. Set the alignment mode of the stack to bottom alignment. By default, the stack is center aligned. Set alignContent to Alignment.BottomStart. Similar to FontWeight, Alignment is a built-in enumeration type provided by the framework. ``` @@ -125,7 +126,7 @@ In this section, we will develop an infographic food details page, by building c 1. By using the built-in enumeration value of Color provided by the framework. For example, backgroundColor(Color.Red) indicates that the background color is set to red. 2. By using the parameter of the string type. The supported color formats are rgb, rgba, and HEX. For example, you can set the background color to blue by setting backgroundColor(??\#0000FF??) and set the background color to white by setting backgroundColor(??rgb(255, 255, 255)??). - + ``` @Entry @Component @@ -150,7 +151,7 @@ In this section, we will develop an infographic food details page, by building c 1. When the parameter is set to Length, the outer margins of the four edges are specified. For example, margin(20) indicates that the outer margins of the top, right, bottom, and left edges are all 20. 2. {top?: Length, right?: Length, bottom?: Length, left?:Length} specifies the margins of the four edges. For example, margin({ left: 26, bottom: 17.4 }) indicates that the left margin is 26 and the bottom margin is 17.4. - + ``` @Entry @Component -- GitLab