Widgets 2.0 Picker Wheel Snapping Issue Not Fixed?

I’ve been reading through the forums and it seems that this was supposedly fixed in build 2100, but I’m using 2014.2162 and still getting an issue.

The picker wheel doesn’t snap to the highlighted option or even the option directly above or below it, it skips up/down a few. This will be incredibly frustrating for users, as the target audience are physicians and nurses who need to quickly reference information.

Is there any code I can add to make it snap?

https://www.youtube.com/watch?v=YmpDvdlN39s

No cure that I’m aware of. Needs to be fixed by CL I suppose. I just noticed it also acts funny on Android. Have you done any testing on Android?

I’ve only started creating this version for iOS. I started building it last year, so it was all 1.0 and storyboard. Google Play accepted it as is, but Apple rejected it for not meeting their standards.

I decided since I have to redo it, I might as well migrate to graphics 2.0, composer and widgets 2.0. Instead of a giant list of scrollable buttons, I thought Apple might like an iOS-style picker wheel instead. This is where I found the errors.

When I used widgets 1.0 picker wheel, it was a mess (I had a previous forum post about it), so that’s when I decided just to migrate everything. Looks like 2.0 still has bugs, though.

Sorry to hear about the challenge. Widgets became much more buggy and unstable post G2 introduction. There were some bug fixes recently but still more and more bugs are coming out on a daily basis.

Is this fixed, yet?  I use the picker widget over and over in my app and it’s really annoying that it’s not working well.

Not yet as of CoronaSDK 2014.2234, but hopefully very soon.

Good news.  I downloaded the latest Widgets 2.0 from GitHub per the following link.

https://github.com/coronalabs/framework-widget

This version fixes the snapping issue above; but also has another issue with bouncing when trying to reach the last 3 records. Annoying; but at least managable.  Below is an example of what I added to resolve this issue.

        local vLaborName = {}

        for i = 1, #laborData do

            --vLaborName[i] = laborData[i][“LaborName”]

            vLaborName[i] = laborData[i].LaborName

            --print(laborData[i].LaborName)

            i = i + 1

        end

        --Below adds 3 records to the table the picker is based on

        vlaborDataCount = #laborData

        vlaborDataCount = vlaborDataCount + 1

        vLaborName[vlaborDataCount] = " "

        vlaborDataCount = vlaborDataCount + 1

        vLaborName[vlaborDataCount] = " "

        vlaborDataCount = vlaborDataCount + 1

        vLaborName[vlaborDataCount] = " " 

Does this issue go away if you put the picker at the bottom of the screen?

Also are you resizing the picker in any way? Doing so will break it for sure. Resizing includes but is not limited to: scaling, changing .width,.height etc.

I’ve used default sized pickers at the bottom of the screen in a few client apps without seeing this issue. As recently as 2 months ago.

If you *are* changing the size of the picker you can disregard the “placing the picker at the bottom of the screen” comment.

Hope this helps.

Nope; but I do relocate it to the bottom of the screen.  I forgot to mention that this picker is way to the right by default.  Below the “left = -160” resolves it. 

        local vHours = {0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 6, 6.5, 7, 7.5, 8, 8.5, 9, 9.5, 10, 10.5, 11, 11.5, 12, 12.5, 13, 13.5, 14, 14.5, 15, 15.5, 16, 16.5, 17, 17.5, 18, 18.5, 19, 19.5, 20, 20.5, 21, 21.5, 22, 22.5, 23, 23.5, 24, 24.5, 25, 25.5}

        

        – Create a new Picker Wheel

        pWheelLabor = widget.newPickerWheel ({

            top = 145,

            left = -160,

            font = “Helvetica”,

            fontSize = 18,

            columns = 

        { 

        { 

            align = “right”,

            width = 170,

            startIndex = 1,

            labels = vLaborName,

        },

        {

            align = “left”,

            width = 100,

            startIndex = 15,

            labels = vHours,

        },

        }

            })

No cure that I’m aware of. Needs to be fixed by CL I suppose. I just noticed it also acts funny on Android. Have you done any testing on Android?

I’ve only started creating this version for iOS. I started building it last year, so it was all 1.0 and storyboard. Google Play accepted it as is, but Apple rejected it for not meeting their standards.

I decided since I have to redo it, I might as well migrate to graphics 2.0, composer and widgets 2.0. Instead of a giant list of scrollable buttons, I thought Apple might like an iOS-style picker wheel instead. This is where I found the errors.

When I used widgets 1.0 picker wheel, it was a mess (I had a previous forum post about it), so that’s when I decided just to migrate everything. Looks like 2.0 still has bugs, though.

Sorry to hear about the challenge. Widgets became much more buggy and unstable post G2 introduction. There were some bug fixes recently but still more and more bugs are coming out on a daily basis.

Is this fixed, yet?  I use the picker widget over and over in my app and it’s really annoying that it’s not working well.

Not yet as of CoronaSDK 2014.2234, but hopefully very soon.

Good news.  I downloaded the latest Widgets 2.0 from GitHub per the following link.

https://github.com/coronalabs/framework-widget

This version fixes the snapping issue above; but also has another issue with bouncing when trying to reach the last 3 records. Annoying; but at least managable.  Below is an example of what I added to resolve this issue.

        local vLaborName = {}

        for i = 1, #laborData do

            --vLaborName[i] = laborData[i][“LaborName”]

            vLaborName[i] = laborData[i].LaborName

            --print(laborData[i].LaborName)

            i = i + 1

        end

        --Below adds 3 records to the table the picker is based on

        vlaborDataCount = #laborData

        vlaborDataCount = vlaborDataCount + 1

        vLaborName[vlaborDataCount] = " "

        vlaborDataCount = vlaborDataCount + 1

        vLaborName[vlaborDataCount] = " "

        vlaborDataCount = vlaborDataCount + 1

        vLaborName[vlaborDataCount] = " " 

Does this issue go away if you put the picker at the bottom of the screen?

Also are you resizing the picker in any way? Doing so will break it for sure. Resizing includes but is not limited to: scaling, changing .width,.height etc.

I’ve used default sized pickers at the bottom of the screen in a few client apps without seeing this issue. As recently as 2 months ago.

If you *are* changing the size of the picker you can disregard the “placing the picker at the bottom of the screen” comment.

Hope this helps.

Nope; but I do relocate it to the bottom of the screen.  I forgot to mention that this picker is way to the right by default.  Below the “left = -160” resolves it. 

        local vHours = {0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 6, 6.5, 7, 7.5, 8, 8.5, 9, 9.5, 10, 10.5, 11, 11.5, 12, 12.5, 13, 13.5, 14, 14.5, 15, 15.5, 16, 16.5, 17, 17.5, 18, 18.5, 19, 19.5, 20, 20.5, 21, 21.5, 22, 22.5, 23, 23.5, 24, 24.5, 25, 25.5}

        

        – Create a new Picker Wheel

        pWheelLabor = widget.newPickerWheel ({

            top = 145,

            left = -160,

            font = “Helvetica”,

            fontSize = 18,

            columns = 

        { 

        { 

            align = “right”,

            width = 170,

            startIndex = 1,

            labels = vLaborName,

        },

        {

            align = “left”,

            width = 100,

            startIndex = 15,

            labels = vHours,

        },

        }

            })