简体   繁体   中英

monotouch keyboard can't be hidden with EndEditing (in ScrollView)

i saw some questions like mine, but they are alle a lidle different. I make an ipad applikation and i worked with the EndEvent bevor end every time it works. But in the newest constellation it wont.

I've a ViewController with a ScrollView in it. Inside the ScrollView Im loading another View. The View has some Textfields. Now the first problem was that the touchevents of my textfields doesent fire. Ok I fixed it by calling the EditingDidBegin and hide the keyboard with view.EditingEnd(true) . The EditingDidBegin calls another ViewController.

txtPosition.EditingDidBegin += delegate(object sender, EventArgs e) {
                                 View.EndEditing(true);
                                 selection = new SelectionViewController(lead, parent);
                                 parent.NavigationController.PushViewController(selection, true);
                                 selection.CreatePositionTable();
                               };

Know the Problem when I use a normal textbox in the view before the keyboard appears, and when i hit my textfields described above the keyboard does not dissapear. I tried to call the EndEditing Method on any Element and any Position the Keyboard is still there on the loaded new View. Not even the user can hide the keyboard by clicking the hide keyboard button on it self! It feels like a bug... I also tried to use the resignFirstResponder solutions in the questions that are like mine but no change the keyboard cannot be hidden.

I hope somone can help me with it.

PS: When i call the View with its textfields outside of the scrollview everything works fine...

To hide the keyboard, generally you use:

yourTextField.ResignFirstResponder()

Although, to be honest I'm a bit confused by what you are trying to do. Why are you wanting to hide the keyboard on EditingDidBegin ?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM