Huawei HCIP-HarmonyOS Application Developer V1.0 H14-231_V1.0 Question # 59 Topic 6 Discussion

Huawei HCIP-HarmonyOS Application Developer V1.0 H14-231_V1.0 Question # 59 Topic 6 Discussion

H14-231_V1.0 Exam Topic 6 Question 59 Discussion:
Question #: 59
Topic #: 6

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.

Ohos:text_state_off="ON"

Ohos:text_state_on="OFF">


C.

Switch btnSwitch=

(Switch)findComponentByld(ResourceTable.ld_btn_switch); btnSwitch.setStateOffText(ON);

btnSwitch.setStateONText(OFF);


D.

Ohos:text_state_off="OFF"

Ohos:text_state_on="ON">


Get Premium H14-231_V1.0 Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.