Note that there are some explanatory texts on larger screens.

plurals
  1. POMonoTouch.Dialog: Dismissing keyboard by touching anywhere in DialogViewController
    text
    copied!<p><em>NOTE: There are two similar SO questions <strong><a href="https://stackoverflow.com/questions/3463778/can-i-dismiss-the-iphone-keyboard-by-touching-the-background-of-dialogviewcontro">(1)</a> <a href="https://stackoverflow.com/questions/7408937/monotouch-dialog-dismissing-a-keyboard">(2)</a></strong>, but neither of them provides an answer.</em></p> <p><strong>TL;DR: How can one dismiss the keyboard in a MonoTouch.Dialog by letting the user touch any empty space in the view?</strong></p> <p>I'm writing an app using MonoTouch.Dialog and a UITabBarController. One of my tabs is "Settings"...</p> <p><img src="https://i.stack.imgur.com/QwNaR.png" alt="Settings screen"></p> <p>When the user starts typing, the keyboard obstructs the tabbar...</p> <p><img src="https://i.stack.imgur.com/ks7Qm.png" alt="enter image description here"></p> <p>Using MonoTouch.Dialog, the only way to dismiss the keyboard is to go to the last field and press the "return" key. Considering the fact that the user cannot press any tab until the keyboard is gone, I would like a better way to do it. Namely, to dismiss if the user taps anywhere else on the screen.</p> <p>Without MonoTouch.Dialog, it's a snap: simply override TouchesBegan and call EndEditing. But this doesn't work with MT.D. I've tried subclassing DialogViewController and overriding TouchesBegan there, but it doesn't work. I'm currently at a loss.</p> <p>Or, I wonder, would I be better off ditching the tabbar so I can use a UINavigationController with a "Back" button on top, which won't be hidden by the keyboard?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload