如下是一个将连接中断播报出来的例子。
@Entry
@Component
export struct Rule_2_1_9 {
title: string = 'Rule 2.1.9';
build() {
NavDestination() {
Column() {
Flex({
direction: FlexDirection.Column,
alignItems: ItemAlign.Center,
justifyContent: FlexAlign.Center,
}) {
Row() {
Text('Connection state').fontSize(30)
}
Row() {
Radio({ value: 'Radio1', group: 'radioGroup' }).checked(true)
.radioStyle({
checkedBackgroundColor: Color.Red
})
.height(50)
.width(50)
.onChange((isChecked: boolean) => {
console.info('Radio1 status is: ', isChecked);
})
Text('Connection interrupted').fontColor(Color.Red)
}
.width('80%')
.accessibilityGroup(true) // 将单选和文本合并到单个对象中。
}
.width('100%')
.height('100%')
.backgroundColor(Color.White)
}
}.title(this.title)
}
}