I ran it on my iPhone 5 and it seemed to work as expected. I don’t have an iPhone 4 to test on, but this widget really doesn’t do any heavy lifting that would tax the CPU or GPU.
Are there possibly other things going on in your app that could be impacting it? Here is the sample code I used to test your button (I had to hack in the myData structure:
local widget = require("widget") local myData = {} myData.leftX = 10 local function radioSwitchListener( event ) -- Update the status box text --print tostring( event.target.isOn ) if event.target.isOn then if event.target.id == "Home" then betID = homeTeamID betOdds = teamAWinOdds elseif event.target.id == "Away" then betID = awayTeamID betOdds = teamBWinOdds elseif event.target.id == "Draw" then betID = 99 --Draw betOdds = drawOdds end end return true end local radioButtonOne = widget.newSwitch { left = myData.leftX + 130, top = display.contentCenterY - 230, style = "radio", id = "Home", initialSwitchState = true, onPress = radioSwitchListener, } local radioButtonTwo = widget.newSwitch { left = myData.leftX + 130, top = display.contentCenterY - 160, style = "radio", id = "Away", initialSwitchState = false, onPress = radioSwitchListener, } local radioButtonThree = widget.newSwitch { left = myData.leftX + 130, top = display.contentCenterY - 90, style = "radio", id = "Draw", initialSwitchState = false, onPress = radioSwitchListener, }
Perhaps if you try to run just that in a main.lua by itself and see how it behaves.
Rob