1# ArkUI子系统Changelog 2 3## cl.arkui.1 废弃gridSpan和gridOffset属性 4**访问级别** 5 6公开接口 7 8**废弃原因** 9 10gridSpan和gridOffset属性仅设置在gridContaier的子组件上有效,gridContainer组件已废弃。 11 12**废弃影响** 13 14该变更为接口废弃,开发者需使用替代接口。 15 16**废弃发生版本** 17 18从OpenHarmony SDK 5.0.0.56开始。 19 20**废弃的接口/组件** 21 22| 废弃接口 | 替代接口 | 23| :---------------------------: | :----------------------------------------: | 24| gridSpan(value: number): T; | GridCol(option?: GridColOptions)中的span | 25| gridOffset(value: number): T; | GridCol(option?: GridColOptions)中的offset | 26 27**适配指导** 28 29废弃前使用gridSpan、gridOffset属性的栅格。 30 31```ts 32// xxx.ets 33@Entry 34@Component 35struct GridContainerExample1 { 36 build() { 37 Column() { 38 Text('gridSpan,gridOffset').fontSize(15).fontColor(0xCCCCCC).width('90%') 39 GridContainer() { 40 Row() { 41 Row() { 42 Text('Left').fontSize(25) 43 } 44 .gridSpan(1) 45 .height("100%") 46 .backgroundColor(0x66bbb2cb) 47 48 Row() { 49 Text('Center').fontSize(25) 50 } 51 .gridSpan(2) 52 .gridOffset(1) 53 .height("100%") 54 .backgroundColor(0x66b6c5d1) 55 56 Row() { 57 Text('Right').fontSize(25) 58 } 59 .gridSpan(1) 60 .gridOffset(3) 61 .height("100%") 62 .backgroundColor(0x66bbb2cb) 63 }.height(200) 64 } 65 } 66 } 67} 68``` 69 70使用GridRow容器,并且子组件为GridCol。GridCol构造中设置span(对应废弃的gridSpan)、offset(对应废弃的gridOffset)属性的栅格。 71```ts 72// xxx.ets 73@Entry 74@Component 75struct GridRowExample { 76 @State bgColors: Color[] = [Color.Red, Color.Orange, Color.Yellow, Color.Green, Color.Pink, Color.Grey, Color.Blue, Color.Brown] 77 @State currentBp: string = 'unknown' 78 79 build() { 80 Column() { 81 GridRow({ 82 columns: 5, 83 gutter: { x: 5, y: 10 }, 84 breakpoints: { value: ["400vp", "600vp", "800vp"], 85 reference: BreakpointsReference.WindowSize }, 86 direction: GridRowDirection.Row 87 }) { 88 GridCol({ span: { xs: 1, sm: 2, md: 3, lg: 4 }, offset: 0, order: 0 }) { 89 Text('Left').fontSize(25) 90 }.borderColor(color).borderWidth(2) 91 GridCol({ span: { xs: 1, sm: 2, md: 3, lg: 4 }, offset: 1, order: 0 }) { 92 TText('Center').fontSize(25) 93 }.borderColor(color).borderWidth(2) 94 GridCol({ span: { xs: 1, sm: 2, md: 3, lg: 4 }, offset: 2, order: 0 }) { 95 Text('Right').fontSize(25) 96 }.borderColor(color).borderWidth(2) 97 }.width("100%").height("100%") 98 .onBreakpointChange((breakpoint) => { 99 this.currentBp = breakpoint 100 }) 101 }.width('80%').margin({ left: 10, top: 5, bottom: 5 }).height(200) 102 .border({ color: '#880606', width: 2 }) 103 } 104} 105``` 106 107## cl.arkui.3 RichEditor(富文本)在光标处于文本起始位置情况时向前删除空文本onWillChange回调变更 108 109**访问级别** 110 111公开接口 112 113**变更原因** 114 115RichEditorController构造的富文本:光标位于文本起始位置时向前删除,触发onWillChange回调范围是[-1, -1],不符合接口定义。 116RichEditorStyledStringController构造的富文本:光标位于文本起始位置时向前删除,触发onWillChange回调范围是[0, 1],不符合接口定义。 117 118**变更影响** 119 120该变更为不兼容变更。 121 122| 组件 | 变更前 | 变更后 | 123|------------------------------------ | ---------------------------------------|---------------------------------------| 124|RichEditorController构造的富文本| 光标位于文本起始位置时向前删除,触发onWillChange回调范围是[-1, -1]。 | 光标位于文本起始位置时向前删除,触发onWillChange回调范围是[0, 0]。| 125|RichEditorStyledStringController构造的富文本| 光标位于文本起始位置时向前删除,触发onWillChange回调范围是[0, 1]。| 光标位于文本起始位置时向前删除,触发onWillChange回调范围是[0, 0]。| 126 127**起始API Level** 128 129API 12。 130 131**变更发生版本** 132 133从OpenHarmony SDK 5.0.0.56开始。 134 135**变更的接口/组件** 136 137onWillChange 138 139**适配指导** 140 141默认行为变更,无需适配,但应注意变更后的行为是否对整体应用逻辑产生影响。