Egret learning diary entry --- Chapter 21. (Section 9.3 to 9.6 book content)

Twenty-one (9.4 to 9.6 book section content)

  Yesterday, the fourth 9.3 Key questions:

    I still do not understand. Section 9.3 and 4 focus, it did not mention the issue exml and ts associated. Cause I think there are other ways of custom components.

    However, custom components, is at least in front of the contact. Before I can based on the knowledge learned, to do a custom component.

      1. Create a file MyButton.ts good associated.

      

      2, unfortunately, with the way the code to create custom buttons, there is no label attribute.

      

      Then I changed a bit MyButton class inheritance.

      

      Normal.

      

      So, the way to solve the problem, is this:

        1, the prototype EUI component inherits class EUI prototype assembly.

   Thus, section 9.3 4 yesterday focused problem has been resolved.

 

  Start section 9.4 content.

  

  

  

  

  

  

  

  

  

  

  

  Key:

    1, the control code status ToggleButton.

    2, The ToggleSwitch by code control, and monitor the switching state.

    3, view the status of ToggleSwitch.

  operating:

    1, the control code status ToggleButton.

      

    2, The ToggleSwitch by code control, and monitor the switching state.

      Code is relatively simple.

      

    3, view the status of ToggleSwitch.

      There are six states.

 

      

      According to their needs, adjust each state to show skin. As for how to adjust, I believe will be a. After all, previous knowledge points.

   At this point, the contents of the end of Section 9.4.

 

  Start section 9.5 content.

  

  

  

  

  

  Key:

    1, CheckBox create, monitor, check, enable the setting.

    2, CheckBox skin set.

  operating:

    1, CheckBox create, monitor, check, enable the setting.

      

    2, CheckBox skin set.

      Skin set is simple, before Button and what are the same.

      

      Of course, if the state has other needs, but also do not forget to change the state oh.

      

  At this point, the end of section 9.5 content.

 

  Start section 9.6 content.

  

  

  

  

  

  

  

  

  

  

  

  

  Key:

    1, RadioButton is created.

    2, several important properties of the RadioButton.

 

    3, RadioButtonGroup optimized use.

  operating:

    1, RadioButton is created.

      First drag components.

      

      After a good change the name of the component, but also give each component in turn changing for the better group name.

      

      我直接在源码里改,这样快点。

      

      别忘记起好id名。

      

      新建好关联代码类。

      

      运行后。

      

    2、RadioButton 的几个重要属性。

      那么来看看重要的属性吧。

      

      可以看到,value是没有的。

      

      设置一下value。

      

      可以看到,value就有了。

      

    3、RadioButtonGroup 的优化使用。

       代码中,这种监听方式太麻烦了。

      

      来优化一下。

      

      这样写后,直接相当于省了 RadioButtonUser.exml 和 RadioButtonUserTs.ts 文件。

      

  至此,9.6节 内容结束。

 

  哇今天又是好晚了,都21点了。

Guess you like

Origin www.cnblogs.com/dmc-nero/p/11270069.html