Forum Xamarin.Android

Can't get the NumberPickers from TimePicker - Android version 7.0 (API 24)

AlonromAlonrom Member ✭✭
edited October 2018 in Xamarin.Android


I have an Android.Widget.NumberPicker in my app and I'm using a FindAllChildernByType method to get the NumberPickers inside.
It seems that the NumberPicker is different on Android version 7.0 (API 24). There is no NumberPickers, only TexViews, so when running on this OS, the app crashes.

Is it a known issue? Thus anyone came up with a nice solution for this?

Best Answer


  • AlonromAlonrom Member ✭✭
    edited October 2018
    public static IEnumerable<T> FindAllChildernByType<T>(ViewGroup viewGroup) where T : View
            for (var i = 0; i < viewGroup.ChildCount; i++)
                var child = viewGroup.GetChildAt(i);
                if (child != null && child is T)
                    yield return (T)child;
                var childViewGroup = child as ViewGroup;
                if (childViewGroup != null)
                    foreach (T childOfChild in FindAllChildernByType<T>(childViewGroup))
                        yield return childOfChild;
  • HI All,
    the posted solution, unfortunately, does not work, I'm using forms v. 4.0.0497661, deploying to android 6.0.1. My goal is to change the minute picker interval to 15 mins (and stay still in clock mode), and it seems that there's no access to the MinutePicker from TimePicker or TimePicker dialog (via CustomRenderer),

    I will have to debug the source code, if not then...implement completely new control as I cannot get easy the Numberpicker( Android.Widget) to clock mode.

    Any suggestions appreciated.


  • AnjaWiAnjaWi DEMember
    edited November 2019

    @TomaszLubocki.1108: Hi, any solution for that? I have the same problem.

  • SheemuSheemu USMember ✭✭✭

    TomaszLubocki.1108, HI any solution for that? also, I have the same problem.

  • dungodungo Member

    i have same problem, i cant find number picker by using android 8.0, help me :(

Sign In or Register to comment.