1# arkui子系统ChangeLog 2 3## cl.arkui.1 系统组件父子校验 4 5从API version11开始,当`Blank`,`FlowItem`,`GridItem`,`GridCol`,`ListItem`,`ListItemGroup`,`Option`,`Span`,`StepperItem`,`TabContent`组件的父组件不是限定组件时,编译报错。 6 7**示例:** 8 9``` 10@Entry 11@Component 12struct Index { 13 build() { 14 Button(){ 15 Blank() 16 } 17 } 18} 19``` 20 21**变更影响** 22 23如果`Blank`,`FlowItem`,`GridItem`,`GridCol`,`ListItem`,`ListItemGroup`,`Span`,`StepperItem`,`TabContent`组件的父组件没有写在限定的组件中,编译报错 。父组件为`if`组件,`ForEach`组件,`LazyForEach`组件, `@Builder`修饰的方法中,编译不会报错。 24 25``` 26// ArkTS:ERROR The 'Blank' component can only be nested in the 'Row,Column,Flex' parent component. 27Button(){ 28 Blank() 29 } 30``` 31 32**关键的接口/组件变更** 33 34不涉及。 35 36**适配指导** 37 38请查阅[Blank组件](../../../application-dev/reference/arkui-ts/ts-basic-components-blank.md),[FlowItem组件](../../../application-dev/reference/arkui-ts/ts-container-flowitem.md),[GridItem组件](../../../application-dev/reference/arkui-ts/ts-container-griditem.md),[GridCol组件](../../../application-dev/reference/arkui-ts/ts-container-gridcol.md),[ListItem组件](../../../application-dev/reference/arkui-ts/ts-container-listitem.md),[ListItemGroup组件](../../../application-dev/reference/arkui-ts/ts-container-listitemgroup.md),[Span组件](../../../application-dev/reference/arkui-ts/ts-basic-components-span.md),[StepperItem组件](../../../application-dev/reference/arkui-ts/ts-basic-components-stepperitem.md),[TabContent组件](../../../application-dev/reference/arkui-ts/ts-container-tabcontent.md)文档进行适配。 39 40## cl.arkui.2 Flex组件wrap模式尺寸约束属性constraintSize生效变更 41 42从API version 11开始,当Flex组件wrap模式下使用属性constraintSize可以正常对交叉轴约束生效。 43 44**示例:** 45 46``` 47@Entry 48@Component 49struct ClipExample1 { 50 @State message: string = 'Hello World' 51 build() { 52 Row() { 53 Column() { 54 Text(this.message) 55 .fontSize(50) 56 .fontWeight(FontWeight.Bold) 57 Flex({wrap:FlexWrap.Wrap}) { 58 Text('1').height(50).backgroundColor(Color.Gray) 59 Text('天天向上').height(50).backgroundColor(Color.Gray) 60 Text('天天向上向上').height(50).backgroundColor(Color.Gray) 61 Text('天天向上向上天天向上向上').height(50).backgroundColor(Color.Gray) 62 Text('1天天向上向上').height(50).backgroundColor(Color.Gray) 63 Text('1天天向上向上').height(50).backgroundColor(Color.Gray) 64 Text('天天向上向上天天向上向上').height(50).backgroundColor(Color.Gray) 65 Text('天天向上向上天天向上向上').height(50).backgroundColor(Color.Gray) 66 Text('1').height(50).backgroundColor(Color.Gray) 67 Text('1').height(50).backgroundColor(Color.Gray) 68 Text('1').height(50).backgroundColor(Color.Gray) 69 } 70 .clip(true) 71 .backgroundColor(Color.Orange) 72 .constraintSize({ 73 minHeight: 50, 74 maxHeight: 150 75 }) 76 } 77 .width('100%') 78 }.height('100%').width(300) 79 } 80} 81``` 82 83**变更影响** 84 85变更前示例中Flex组件实际高度为200,没有受constraintSize中maxHeight约束,变更后constraintSize约束能正常生效,最小高度为50,最大高度为150,最大最小宽度约束同理可正常生效。 86 87**适配指导** 88 89若之前使用了wrap并且设置了constraintSize并未对Flex容器大小约束成功,API version 11及以上版本会正常生效,应用若不想要该约束则将constraintSize移除或调整约束数值。 90 91## cl.arkui.3 Scroll组件currentOffset接口变更 92 93**访问级别** 94 95公开接口。 96 97**变更原因** 98 99currentOffset接口的返回值为any,不利于代码开发时的自动提示。 100 101**变更影响** 102 103该变更为非兼容性变更,Scroll组件中currentOffset接口的返回值由any变更为OffsetResult。 104 105**API Level** 106 10711 108 109**变更发生版本** 110 111从OpenHarmony SDK 4.1.2.3开始。 112 113**变更的接口/组件** 114 115API version 10前 ,currentOffset接口的返回值为any: 116``` 117currentOffset(); 118``` 119 120API version 11及以后,currentOffset接口的返回值为OffsetResult: 121``` 122currentOffset() : OffsetResult; 123``` 124 125**适配指导** 126 127不涉及 128