I have two problems with the newSwitch widget
- I’m using the style “onOff”.
Concerning to the documentation http://docs.coronalabs.com/api/library/widget/newSwitch.html I should be able to use onPress, onRelease or onEvent.
The only way to get the event callback fired is using onPress.
Is this the way it’s supposed to be ?
-
In the eventHandler of onPress I set the state of onOff-switch using
switch:setState({isOn=false})
Unfortunately it’s switches to a mixed state. The switch goes to the “off” position but keeps the “on”-color.
See third row of screenshot (on - off - mixed/broken ).
How can I avoid this ?