/
/
xxx.ets
import
promptAction
from
'@ohos.promptAction'
;
@Entry
@Component
struct Index {
build() {
Row() {
Column() {
Radio({ value:
'Radio1'
, group:
'radioGroup'
}).checked(true)
.height(
50
)
.width(
50
)
.onChange((isChecked: boolean)
=
> {
if
(isChecked) {
/
/
切换为响铃模式
promptAction.showToast({ message:
'Ringing mode.'
})
}
})
Text(
'Ringing'
)
}
Column() {
Radio({ value:
'Radio2'
, group:
'radioGroup'
})
.height(
50
)
.width(
50
)
.onChange((isChecked: boolean)
=
> {
if
(isChecked) {
/
/
切换为振动模式
promptAction.showToast({ message:
'Vibration mode.'
})
}
})
Text(
'Vibration'
)
}
Column() {
Radio({ value:
'Radio3'
, group:
'radioGroup'
})
.height(
50
)
.width(
50
)
.onChange((isChecked: boolean)
=
> {
if
(isChecked) {
/
/
切换为静音模式
promptAction.showToast({ message:
'Silent mode.'
})
}
})
Text(
'Silent'
)
}
}.height(
'100%'
).width(
'100%'
).justifyContent(FlexAlign.Center)
}
}