I am using a plain vanilla picker wheel widget with no customization. The widget allows my users to enter their birthday when signing up for an account. Everything works as far as values, days, years, etc. on both IOS and Android. My issue is that it will not stay in place, i.e. the top left corner will either be in the correct location or it will jump to the center of the screen causing the picker wheel to go off to the right of the screen.
The strange part is there is no rhyme or reason as to why it happens or when it will happen. I can do a build and it will work just fine for that build. But the very next build it may (or may not) move the top left corner of the widget to the center of the screen and it will be wrong for everyone. I simply do another build without changing a thing and it will be back in the correct position.
Being a typical guy with a typical bad memory, I do not always remember to check it before I publish my app so it may get published with the bad alignment.
I have tried both of the following and the results are the same:
top = 120, left = 0, x = display.contentWidth \* .5, y = display.contentHeight \* .5,
Has anyone seen this issue before? Below is my code.
Thanks ahead of time,
Scott
local dobMM = 06 local dobDD = 15 local dobYYidx = 50 local startYear = 1930 if (not pickerGroup) then pickerGroup = display.newGroup() end -- Create two tables to hold data for days and years local days = {} local years = {} -- Populate the "days" table for d = 1, 31 do days[d] = d end -- Populate the "years" table for y = 1, 88 do years[y] = startYear + y end -- Configure the picker wheel columns columnData = { -- Months { align = "center", width = 122, startIndex = dobMM, labels = { translations["January"][\_myG["language"]], translations["February"][\_myG["language"]], translations["March"][\_myG["language"]], translations["April"][\_myG["language"]], translations["May"][\_myG["language"]], translations["June"][\_myG["language"]], translations["July"][\_myG["language"]], translations["August"][\_myG["language"]], translations["September"][\_myG["language"]], translations["October"][\_myG["language"]], translations["November"][\_myG["language"]], translations["December"][\_myG["language"]] } }, -- Days { align = "center", width = 20, startIndex = dobDD, labels = days }, -- Years { align = "center", width = 80, startIndex = dobYYidx, labels = years } } if pickerWheel and pickerWheel.removeSelf then pickerWheel:removeSelf() pickerWheel = nil end -- Create the widget local pickerWheel = widget.newPickerWheel( { top = 120, left = 0, columns = columnData } ) pickerGroup:insert(pickerWheel)