Hi All - I have discovered a bug in the Widget 2.0 library:
An iOS7 theme onOff switch gets animated/rendered incorrectly and left in an inconsistent graphical state when setState is used to change it’s state. This behavior only happens in the ios7 theme. It’s demonstrated in the sample code below.
I’ll file a bug report after posting this.
Thanks
[lua]-- Demonstrating bug in widget switch setState method. (main.lua)
– ios7 theme switches are rendered incorrectly when their state is changed via setState
local widget=require(‘widget’)
widget.setTheme(“widget_theme_ios7”)
local master – switch to change
local slave – switch that’s changed via setState when master is changed.
local function masterChanged(event)
slave:setState({isOn=master.isOn})
end
master = widget.newSwitch({left=40,top=50,initialSwitchState=true,onPress=masterChanged})
slave = widget.newSwitch({left=40,top=200,initialSwitchState=true})
[/lua]