Search code examples
xamarintoolbarclickable

Clickable toolbar in Xamarin


I am newest in Xamarin and have question for developers with more experiences.

I want to hide custom picker when user clicks anywhere any view in app. This working with view where is custom picker opened, but when I click on toolbar he remains opened. This problem is existing only on iOS, Android work as expected.

Could i make whole toolbar to be clickable and how?

Thanks in advance


Solution

  • In the Picker Toolbar you can set UIBarButtonItem to add Done button. Then you can add a Click Event for the Done button and write following code in it.

    YourPicker.RemoveFromSuperview();
    YourPickerView.RemoveFromSuperview();
    textField.ResignFirstResponder();