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