I think you need to work out how you want to dismiss it, then trigger
off that. View.EndEditing(true) gets rid of the keyboard, but how you
trigger it is up to you.

The tap gesture isn't too bad, but as you said, it takes over all taps.

I quite like the scroll one - maybe you could also trigger it off the
scroll event/message on the TableView?

Putting a toolbar or view on the keyboard can work, too - PlainText
does it quite well:
https://itunes.apple.com/en/app/plaintext-dropbox-text-editing/id391254385?mt=8

I've never found a solution I liked enough to keep it in, except the
toolbar one, and even then it was clunkey.



On 7 March 2013 08:51, Iki <i...@holisticware.com> wrote:
> Hi guys,
>
> I know that this is probably asked million of times but I can find a nice
> solution to dismiss a keyboard in MonoTouch.Dialog.
>
> On the internet I have found two solutions, one from Miguel,
>
> //Gesture recognizer for handling EndEditing of Elements
>     var tap = new UITapGestureRecognizer ();
>     tap.AddTarget (() =>{ this.View.EndEditing(true); });
>
>     this.View.AddGestureRecognizer (tap);
> //-------------------------------------------------------
>
>
> and another solution from stack overflow
>
> //Hide when dragging start
> this.TableView.DraggingStarted += (object sender, EventArgs e) =>
> {
>    this.View.EndEditing (true);
> };
>
> The problem with these two is that it will block any action that comes from
> tapping other elements
> (example. StringElement) so I can't find a way if using these two to display
> picker element, or UIAlertView.
>
> Do you have any ideas?
>
> Thanks for help!
>
> _______________________________________________
> MonoTouch mailing list
> MonoTouch@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monotouch
>



--
Nic Wise
t.  +44 7788 592 806 | @fastchicken
b. http://www.fastchicken.co.nz/
_______________________________________________
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to