Related questions
Question 395 - H14-231_V1.0 discussion
When a developer is developing a smart home application, the Switch component will be used to represent the switch of some devices, and ON should be displayed on the ON status component and OFF should be displayed on the closed state component, what are the following options that can meet the requirements?
A.
Switch btnSwitch=(Switch)findComponentByld(Resource Table.ld_btn_switch); btnSwitch.setStateOffText('OFF'); btnSwitch.setStateONText('ON');
B.
<Switch...... ohos:text_state_off='ON' ohos:text_state_on='OFF'> </Switch>
C.
Switch btnSwitch=(Switch)findComponentByld(Resource Table.ld_btn_switch); btnSwitch.setStateOffText('ON'); btnSwitch.setStateONText('OFF');
D.
<Switch... ... ohos:text_state_off='OFF' ohos:text_state_on='ON'> </Switch>
Your answer:
0 comments
Sorted by
Leave a comment first