EUI ToggleButton Toggleswitch implements similar music switch buttons

Source: Internet
Author: User

A ToggleButton and Toggleswitch difference

No difference, is to inherit ...

class Toggleswitch extends ToggleButton {        /* * *         @language en_us         * Constructor.         *         * @version egret 2.4         * @version EUI 1.0         * @platform web,native         */*          *         * @language ZH_CN         * constructor. *         * @version egret 2.4         * @version EUI 1.0         * @platform web,native                 * *  Public Constructor () {            super ();        }    }

Two toggleswitch realization music Switch

The skin file is too complex to use several pictures, set the state, and move the white dot position.

<?xml version="1.0"encoding="Utf-8"? ><e:skinclass="Skins. Toggleswitchskin"states="up,down,disabled,upandselected,downandselected,disabledandselected"Xmlns:e="Http://ns.egret.com/eui"> <e:image source="On_png"Source.up="Off_png"Source.down="Off_png"source.disabled="Off_png"/> <e:image source="Handle_png"Horizontalcenter="-18"horizontalcenter.upandselected=" -"horizontalcenter.downandselected=" -"horizontalcenter.disabledandselected=" -"Verticalcenter="0"/></e:skin>

Use two pictures directly, then use ToggleButton normal and press the state more convenient.

EUI ToggleButton Toggleswitch implements similar music switch buttons

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.