Picker rather wonky behaviour in Forms!?

RicardoSRicardoS ESMember ✭✭✭

Another difficult one to explain...

So, we've created a new app. From scratch. And when testing it, it does... unexpected things.

Everybody know what a picker is in Xamarin Forms. You add a list of data (usually, strings), and when you click it (or tap it, whatever you prefer), it shows a floating menu with the available options, alongside two buttons: accept and cancel. Simple stuff.

However, we've discovered that during the popup menu phase, if you click anywhere in the screen, the picker is unresponsive afterwards.
You click on it and nothing happens, no popup menu, nothing. This is increasingly weird, given that in our least recent apps clicking outside the menu causes nothing of the sort.

We know that the easy solution would be telling our users "be careful with the pickers, if you don't want to use them just press cancel".
However, our potential pool of users is way too big to do this. And even then, we all know how users tend to disregard this kind of advices. We need a more permanent solution to this, for future apps and whatnot.

I'll give you a brief example:

xaml pard:
<Picker x:Name="ratePicker" HorizontalOptions="FillAndExpand" SelectedIndexChanged="OnRateChange"/>

CS part:
`protected string rating;

ratePicker.ItemsSource = new List { "5", "4", "3", "2", "1" };

    void OnRateChange (object sender, EventArgs ev) {
        rating = (string) ((Picker) sender).SelectedItem;
    }

`

Best regards

Best Answer

Answers

  • NMackayNMackay GBInsider, University mod

    What platform? What version of Forms?

  • LandLuLandLu Member, Xamarin Team Xamurai
    edited April 23

    @RicardoS It seems you are facing the same issue as the OP of this thread:
    https://forums.xamarin.com/discussion/comment/370963/#Comment_370963
    Have you used some renderers for your Picker? You could try his solution.
    Moreover, try to upload your Forms to the latest version. I've also heard some related issues about Picker, the problem is fixed after they upload the Forms version.

  • RicardoSRicardoS ESMember ✭✭✭

    @NMackay said:
    What platform? What version of Forms?

    Visual Studio for Mac v. 8.0.4

    The Forms version I cannot find.

  • RicardoSRicardoS ESMember ✭✭✭

    @LandLu said:
    @RicardoS It seems you are facing the same issue as the OP of this thread:
    https://forums.xamarin.com/discussion/comment/370963/#Comment_370963
    Have you used some renderers for your Picker? You could try his solution.
    Moreover, try to upload your Forms to the latest version. I've also heard some related issues about Picker, the problem is fixed after they upload the Forms version.

    It seems that this user has separated the code between Android and iOS, however this is for a shared code Forms Solution, sorry

  • JohnHJohnH GBMember ✭✭✭✭✭

    @RicardoS said:

    @NMackay said:
    What platform? What version of Forms?

    Visual Studio for Mac v. 8.0.4

    The Forms version I cannot find.

    Xamarin Forms is a nuget package, get the version of the nuget package you are using.

  • RicardoSRicardoS ESMember ✭✭✭

    @JohnH said:

    @RicardoS said:

    @NMackay said:
    What platform? What version of Forms?

    Visual Studio for Mac v. 8.0.4

    The Forms version I cannot find.

    Xamarin Forms is a nuget package, get the version of the nuget package you are using.

    The project does not have a packages.config file, so I don't know where to look for the version...

  • JohnHJohnH GBMember ✭✭✭✭✭

    @RicardoS said:

    @JohnH said:

    @RicardoS said:

    @NMackay said:
    What platform? What version of Forms?

    Visual Studio for Mac v. 8.0.4

    The Forms version I cannot find.

    Xamarin Forms is a nuget package, get the version of the nuget package you are using.

    The project does not have a packages.config file, so I don't know where to look for the version...

    Right-click on the project, Manage Nuget Packages. Xamarin.Forms will be on the Installed tab.

  • RicardoSRicardoS ESMember ✭✭✭

    @JohnH said:

    @RicardoS said:

    @JohnH said:

    @RicardoS said:

    @NMackay said:
    What platform? What version of Forms?

    Visual Studio for Mac v. 8.0.4

    The Forms version I cannot find.

    Xamarin Forms is a nuget package, get the version of the nuget package you are using.

    The project does not have a packages.config file, so I don't know where to look for the version...

    Right-click on the project, Manage Nuget Packages. Xamarin.Forms will be on the Installed tab.

    Nope, sorry. That option is not available.
    NuGet Packages are in a folder called NuGet that are inside another folder named Dependencies.
    I'm not sure if you're familiar with this file system...

    Just to clarify:

    • Forms Project Name
      • Dependencies (parent folder)
        • NuGet (Packages)
        • Projects (External Libraries and others)
        • SDK (The NETStandard.Library is here)
      • Xaml pages and others
  • JohnHJohnH GBMember ✭✭✭✭✭

    @RicardoS said:

    @JohnH said:

    @RicardoS said:

    @JohnH said:

    @RicardoS said:

    @NMackay said:
    What platform? What version of Forms?

    Visual Studio for Mac v. 8.0.4

    The Forms version I cannot find.

    Xamarin Forms is a nuget package, get the version of the nuget package you are using.

    The project does not have a packages.config file, so I don't know where to look for the version...

    Right-click on the project, Manage Nuget Packages. Xamarin.Forms will be on the Installed tab.

    Nope, sorry. That option is not available.
    NuGet Packages are in a folder called NuGet that are inside another folder named Dependencies.
    I'm not sure if you're familiar with this file system...

    Just to clarify:

    • Forms Project Name
      • Dependencies (parent folder)
        • NuGet (Packages)
        • Projects (External Libraries and others)
        • SDK (The NETStandard.Library is here)
      • Xaml pages and others

    Lol that's funny.
    Right click on the Project within Visual Studio, in the Solution Explorer.

  • RicardoSRicardoS ESMember ✭✭✭

    @JohnH said:

    @RicardoS said:

    @JohnH said:

    @RicardoS said:

    @JohnH said:

    @RicardoS said:

    @NMackay said:
    What platform? What version of Forms?

    Visual Studio for Mac v. 8.0.4

    The Forms version I cannot find.

    Xamarin Forms is a nuget package, get the version of the nuget package you are using.

    The project does not have a packages.config file, so I don't know where to look for the version...

    Right-click on the project, Manage Nuget Packages. Xamarin.Forms will be on the Installed tab.

    Nope, sorry. That option is not available.
    NuGet Packages are in a folder called NuGet that are inside another folder named Dependencies.
    I'm not sure if you're familiar with this file system...

    Just to clarify:

    • Forms Project Name
      • Dependencies (parent folder)
        • NuGet (Packages)
        • Projects (External Libraries and others)
        • SDK (The NETStandard.Library is here)
      • Xaml pages and others

    Lol that's funny.
    Right click on the Project within Visual Studio, in the Solution Explorer.

    Again, nope sorry. The only oplions close to that are Restore NuGet and Update NuGet

  • JohnHJohnH GBMember ✭✭✭✭✭

    @RicardoS said:

    @JohnH said:

    @RicardoS said:

    @JohnH said:

    @RicardoS said:

    @JohnH said:

    @RicardoS said:

    @NMackay said:
    What platform? What version of Forms?

    Visual Studio for Mac v. 8.0.4

    The Forms version I cannot find.

    Xamarin Forms is a nuget package, get the version of the nuget package you are using.

    The project does not have a packages.config file, so I don't know where to look for the version...

    Right-click on the project, Manage Nuget Packages. Xamarin.Forms will be on the Installed tab.

    Nope, sorry. That option is not available.
    NuGet Packages are in a folder called NuGet that are inside another folder named Dependencies.
    I'm not sure if you're familiar with this file system...

    Just to clarify:

    • Forms Project Name
      • Dependencies (parent folder)
        • NuGet (Packages)
        • Projects (External Libraries and others)
        • SDK (The NETStandard.Library is here)
      • Xaml pages and others

    Lol that's funny.
    Right click on the Project within Visual Studio, in the Solution Explorer.

    Again, nope sorry. The only oplions close to that are Restore NuGet and Update NuGet

    Interesting. VS 4 Mac is slightly different when it comes to that menu, I was using Visual Studio on Windows.
    But there are other ways for you to find this, even on the Mac. Open the Packages folder in the project within VS4Mac, it should show you the Xamarin.Forms package. Right click on the Nuget package, it tells you the installed version.

  • JamesLaveryJamesLavery GBBeta, University ✭✭✭✭✭
    edited April 23

    Have you tried expanding the NuGet folder as in the screenshot below? This was taken from VS for Mac 2017.

  • RicardoSRicardoS ESMember ✭✭✭

    @JohnH said:

    @RicardoS said:

    @JohnH said:

    @RicardoS said:

    @JohnH said:

    @RicardoS said:

    @JohnH said:

    @RicardoS said:

    @NMackay said:
    What platform? What version of Forms?

    Visual Studio for Mac v. 8.0.4

    The Forms version I cannot find.

    Xamarin Forms is a nuget package, get the version of the nuget package you are using.

    The project does not have a packages.config file, so I don't know where to look for the version...

    Right-click on the project, Manage Nuget Packages. Xamarin.Forms will be on the Installed tab.

    Nope, sorry. That option is not available.
    NuGet Packages are in a folder called NuGet that are inside another folder named Dependencies.
    I'm not sure if you're familiar with this file system...

    Just to clarify:

    • Forms Project Name
      • Dependencies (parent folder)
        • NuGet (Packages)
        • Projects (External Libraries and others)
        • SDK (The NETStandard.Library is here)
      • Xaml pages and others

    Lol that's funny.
    Right click on the Project within Visual Studio, in the Solution Explorer.

    Again, nope sorry. The only oplions close to that are Restore NuGet and Update NuGet

    Interesting. VS 4 Mac is slightly different when it comes to that menu, I was using Visual Studio on Windows.
    But there are other ways for you to find this, even on the Mac. Open the Packages folder in the project within VS4Mac, it should show you the Xamarin.Forms package. Right click on the Nuget package, it tells you the installed version.

    Sorry, tried right clicking, but only lets me update or remove.

    However, following @JamesLavery advice I was able to see the version. Is 3.6.0.293080

  • RicardoSRicardoS ESMember ✭✭✭

    @JamesLavery said:
    Have you tried expanding the NuGet folder as in the screenshot below? This was taken from VS for Mac 2017.

    Thank you. I always thought that THAT was the, erm... "to be updated" version... If that makes any sense...

  • LandLuLandLu Member, Xamarin Team Xamurai

    @RicardoS If you are meaning this issue also occurs on iOS, please share a sample here.
    It's much easier to find out what happened on your side, as I can't reproduce what you described above with the code you post.

  • RicardoSRicardoS ESMember ✭✭✭

    @LandLu said:
    @RicardoS If you are meaning this issue also occurs on iOS, please share a sample here.
    It's much easier to find out what happened on your side, as I can't reproduce what you described above with the code you post.

    I'm sorry, but I cannot share the app code on our company guidelines...

    Mayhaps I can create a new solution with this?

  • LandLuLandLu Member, Xamarin Team Xamurai

    @RicardoS I don't want your whole project. Could you reproduce it on a blank app?
    This is a regular control on Forms. We don't know what causes that without your code.

  • RicardoSRicardoS ESMember ✭✭✭

    @LandLu
    Unrelated problems on iOS. We're starting over.

  • RicardoSRicardoS ESMember ✭✭✭
    Accepted Answer

    We started anew, with a copy of an existing project, modified to suit or new client's needs.

    However, we stumbled on an old issue, the same that prompted the creation of a new project and the discovery of this bug.

    Here:

    https://forums.xamarin.com/discussion/155680/xamarin-forms-sigsegv-when-release-on-an-android-device#latest

    Regards and apologies for wasting everyone who was involved time.

Sign In or Register to comment.