1# arkui子系统ChangeLog
2
3## cl.arkui.1 stack组件alignContent属性和通用属性align生效顺序
4
5**说明**
6属性之间的处理原则:如果功能相同,属性按覆盖处理即后设置的生效。alignContent和align功能相同,都是子组件在stack容器组件的对齐方式。
7
8**示例:**
9```ts
10// xxx.ets
11@Entry
12@Component
13struct StackExample {
14  build() {
15    Stack({alignContent:Alignment.Start}){
16      Text("Stack's child").backgroundColor(Color.Brown).height("100").width(100)
17    }
18    .width(300).height(300)
19    .backgroundColor(Color.Pink)
20    .align(Alignment.Center)
21    .alignContent(Alignment.TopEnd)
22  }
23}
24```
25
26API version 9:子组件按照通用属性align布局
27
28![stack](figures/api9.png)
29
30
31API version 10及以后:子组件按照后设置的alignContent布局
32
33![stack](figures/api10_and_later.png)
34
35**变更影响**
36
37alignContent和align都设置时,API version 9及以前是align生效,API version 10及以后是后设置的生效。
38
39## cl.arkui.2 canvas组件fillText接口和strokeText接口行为变更
40
41**说明**
42fillText和strokeText接口在绘制文字时,不会换行。
43
44**示例:**
45```ts
46// xxx.ets
47@Entry
48@Component
49struct FillText {
50  private settings: RenderingContextSettings = new RenderingContextSettings(true)
51  private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
52
53  build() {
54    Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
55      Canvas(this.context)
56        .width('100%')
57        .height('100%')
58        .backgroundColor('#ffff00')
59        .onReady(() =>{
60          this.context.font = '50px sans-serif'
61          this.context.fillText("Hello World!", 0, 100)
62          this.context.fillText("Hello World! This is a long string to fully show", 0, 150)
63          this.context.strokeText("Hello World!", 0, 250)
64          this.context.strokeText("Hello World! This is a long string to fully show", 0, 300)
65        })
66    }
67    .width('100%')
68    .height('100%')
69  }
70}
71```
72
73API version 9:fillText和strokeText接口在绘制文字时,会根据组件宽度换行。
74
75![stack](figures/api9filltext.jpeg)
76
77API version 10及以后:fillText和strokeText接口在绘制文字时,不会换行。
78
79![stack](figures/api10filltext.jpeg)
80
81**变更影响**
82
83fillText和strokeText接口在绘制文字时,API version 9及以前是根据组件宽度换行,API version 10及以后是不会换行。