Search code examples
iosxamarin.iosuipickerview

UIPickerView scrolls to the end when clicking outside


I am creating a picker view like this(nothing special):

        var picker = new UIPickerView();
        picker.Model = new DropDownPickerViewModel(items, ItemSelected);
        picker.Select(selected, 0, true);

        InputView = picker;
        InputAccessoryView = null;

Method from Model:

    public override void Selected(UIPickerView pickerView, nint row, nint component)
    {
        itemSelectedEvent?.Invoke((int)row);
    }

When I click on TextField, pickerView opens. I can choose(by scrolling) a value I want, but when I click outside pickerview or oi item it scrolls to the last item and calls Selected method


Solution

  • Never mind. It was a simulator glitch. restarting helped