Did you do anything for the positioning of "widget.newSwitch" in recent daily builds?

I have following code used to work alright,

local orderSwitch = widget.newSwitch { initialSwitchState = origState, onPress = onSwitchPress, onRelease = onSwitchPress, } orderSwitch.anchorX = 1 orderSwitch.anchorY = 0.5 orderSwitch.x = (display.contentWidth - display.screenOriginX) - 18

I am expecting it is placed at the right edge of the screen with 18 pixels space (which has no problem for months).

However, when it is built with recent Corona daily builds, the switch position is not positioned correctly (moved to the right and part of the switch is off-screen)

Could Corona identify this problem?

Build 2159 fixed a number of widget.newSwitch bugs. Alex posted the following list. I’m guessing while fixing those something changed affecting your code. 

#29891 - Switch moves x-location when I scroll in the scroll view.
#29534 - widget.newSwitch missplacement on Android
#28960 - switch widget is displayed wrong in state = true and theme ~= ios7
#29419 - isBounceEnabled in scrollview is shared with all scrollviews.
#29399 - widget switch shifts upon scrolling in scrollView
#29144 - widgets.newSwitch in onOff style moves left & right on x axis when it is  programmatically changed with obj:setState()
#30007 - scrollview problems in compatibility mode.

Thanks, ksan

So… there are two possibilities…

(1) the newSwitch had a bug but now it’s fixed. 

(2) there is a new-introduced bug

Either way, I feel my code is not wrong…

local orderSwitch = widget.newSwitch { initialSwitchState = origState, onPress = onSwitchPress, onRelease = onSwitchPress, } orderSwitch.anchorX = 1 orderSwitch.anchorY = 0.5 orderSwitch.x = (display.contentWidth - display.screenOriginX) - 18

My intention is to put the switch “right-aligned” to the right edge of the screen with a space (18 pixels) in between.

I don’t know why it’s not working any more… probably there is a new bug in Corona widget?

I agree your code looks perfect. Suggest submitting a bug report while the iron is hot. Thanks

Ok, file a bug report, Case 30306

Maybe I am too bold that I always use the latest daily build to publish my app?

Build 2159 fixed a number of widget.newSwitch bugs. Alex posted the following list. I’m guessing while fixing those something changed affecting your code. 

#29891 - Switch moves x-location when I scroll in the scroll view.
#29534 - widget.newSwitch missplacement on Android
#28960 - switch widget is displayed wrong in state = true and theme ~= ios7
#29419 - isBounceEnabled in scrollview is shared with all scrollviews.
#29399 - widget switch shifts upon scrolling in scrollView
#29144 - widgets.newSwitch in onOff style moves left & right on x axis when it is  programmatically changed with obj:setState()
#30007 - scrollview problems in compatibility mode.

Thanks, ksan

So… there are two possibilities…

(1) the newSwitch had a bug but now it’s fixed. 

(2) there is a new-introduced bug

Either way, I feel my code is not wrong…

local orderSwitch = widget.newSwitch { initialSwitchState = origState, onPress = onSwitchPress, onRelease = onSwitchPress, } orderSwitch.anchorX = 1 orderSwitch.anchorY = 0.5 orderSwitch.x = (display.contentWidth - display.screenOriginX) - 18

My intention is to put the switch “right-aligned” to the right edge of the screen with a space (18 pixels) in between.

I don’t know why it’s not working any more… probably there is a new bug in Corona widget?

I agree your code looks perfect. Suggest submitting a bug report while the iron is hot. Thanks

Ok, file a bug report, Case 30306

Maybe I am too bold that I always use the latest daily build to publish my app?