1# ArkUI子系统Changelog 2 3## cl.arkui.1 TextInput组件在非标准字体场景下showCounter接口布局变更 4 5**访问级别** 6 7公开接口 8 9**变更原因** 10 11在大字体时,showCounter所属的TextInput组件的下侧Margin空间不足。 12 13**变更影响** 14 15该变更为不兼容变更。 16 17变更前:在设置showCounter后,TextInput组件的下侧Margin大小为固定的22vp,showCounter的垂直偏移量为字体高度。 18 19变更后:在设置showCounter后,标准字体下,TextInput组件的下侧Margin以及垂直偏移量和变更前保持一致。非标准字体设置下,TextInput组件的下侧Margin大小为16vp加上showCounter的字体高度,垂直偏移量为8vp。 20 21设置非标准字体时,变更前后对比效果如下图所示: 22| 变更前 | 变更后 | 23|---------|---------| 24||| 25 26示例: 27 28```ts 29@Entry 30@Component 31struct Index { 32 @State message: string = 'Hello World'; 33 34 build() { 35 Column() { 36 TextInput({text: "输入文字1"}) 37 .showCounter(true) 38 .maxLength(10) 39 TextInput({text: "输入文字2"}) 40 } 41 .height('100%') 42 .width('100%') 43 } 44} 45``` 46 47**起始API Level** 48 49API 11 50 51**变更发生版本** 52 53从OpenHarmony SDK 5.0.0.50开始。 54 55**变更的接口/组件** 56 57TextInput组件showCounter接口。 58 59**适配指导** 60 61默认效果变更,无需适配,但应注意变更后的默认效果是否符合开发者预期,如不符合则应自定义修改效果控制变量以达到预期。 62 63## cl.arkui.2 GestureGroupGestureHandlerOptions参数mode默认值变更 64 65**访问级别** 66 67公开接口 68 69**变更原因** 70 71为了与GestureGroupInterface接口行为保持一致,GestureGroupGestureHandlerOptions参数mode默认值由GestureMode.Exclusive变更为GestureMode.Sequence。 72 73**变更影响** 74 75该变更为不兼容变更。 76 77变更前:GestureGroupGestureHandlerOptions参数mode默认值为GestureMode.Exclusive,当开发者未设置该参数时,默认GestureGroup下的多个手势组成互斥手势组。 78 79变更后:GestureGroupGestureHandlerOptions参数mode默认值为GestureMode.Sequence,当开发者未设置该参数时,默认GestureGroup下的多个手势组成顺序手势组。 80 81**起始API Level** 82 83API 12 84 85**变更发生版本** 86 87从OpenHarmony SDK 5.0.0.50开始。 88 89**变更的接口/组件** 90 91gesture.d.ts文件GestureGroupGestureHandlerOptions接口。 92 93**适配指导** 94 95如果使用了GestureGroupGestureHandlerOptions接口并传入了异常值,想要保持手势组中手势为互斥手势,则需要将mode设置为GestureMode.Exclusive;否则,可以保持其原有状态。 96 97示例: 98 99```ts 100class MyModifierGestureGroup implements GestureModifier { 101 applyGesture(event: UIGestureEvent): void { 102 event.addGesture( 103 // 将手势组的mode设置为GestureMode.Exclusive,使手势组中的手势组合成为互斥手势组。 104 new GestureGroupHandler({ mode: GestureMode.Exclusive, gestures: [ 105 new LongPressGestureHandler() 106 .onAction(() => {}), 107 new PanGestureHandler() 108 .onActionStart(() => {}) 109 .onActionEnd(() => {}) 110 ] }) 111 ) 112 } 113} 114 115@Entry 116@Component 117struct ModifierGesture { 118 @State modifierGroup: MyModifierGestureGroup = new MyModifierGestureGroup() 119 build() { 120 Column() { 121 Text("Modifier手势组") 122 .width(150) 123 .height(150) 124 .gestureModifier(this.modifierGroup as MyModifierGestureGroup) 125 } 126 } 127} 128``` 129 130## cl.arkui.3 PanGestureInterface参数distance效果变更 131 132**访问级别** 133 134公开接口 135 136**变更原因** 137 138为了参数distance设置特殊值时行为逻辑与正常值行为逻辑保持一致,当参数distance设置为0时行为逻辑发生变化。 139 140**变更影响** 141 142该变更为不兼容变更。 143 144变更前:当PanGestureInterface参数distance设置为0时,手指触摸后(手指未发生移动),组件不触发PanGesture的回调。 145 146变更后:当PanGestureInterface参数distance设置为0时,手指触摸后(手指未发生移动),组件触发PanGesture的回调。 147 148 149**起始API Level** 150 151API 7 152 153**变更发生版本** 154 155从OpenHarmony SDK 5.0.0.50开始。 156 157**变更的接口/组件** 158 159gesture.d.ts文件GestureGroupGestureHandlerOptions接口。 160 161**适配指导** 162 163如果使用了PanGestureInterface接口,当手指移动距离达到设置的distance时,将触发PanGesture的回调。如果想要保持手指触摸后组件不触发PanGesture的回调,可以将distance设置为大于0的值。 164 165示例: 166 167```ts 168@Entry 169@Component 170struct PanGesture { 171 build() { 172 Column() { 173 Text("PanGesture") 174 .width(150) 175 .height(150) 176 .gesture( 177 // 设置滑动手势的滑动距离为5vp 178 PanGesture({distance: 5}) 179 .onActionStart(() => {}) 180 ) 181 } 182 } 183} 184``` 185