I am not able to hide the keyboard in my app.
My app has 2 view.., The first view loads the another view. But when I do resignFirstResponder.., nothing is working...
are you calling resignFirstResponder on a text component, like a UITextField or UITextView? Calling it on the containing view won't work.
Related
I have a UIMenuController which is presented when a UIView is tapped. I have implemented the canPerformAction and canBecomeFirstResponder methods, and it works when the view is first loaded. The app is navigated by a tab view, and if a user is to switch to another view and then back to the first (although the same issue occurs if a modal view is presented from the first view), the UIMenuController will no longer show up. Any ideas as to why this could be?
I just worked out the answer: I have to manually call becomeFirstResponder on my view in order for it to work.
Is there any way to keep a UITextField first responder even as I push another view controller?
Essentially, I'm taking a screenshot of the screen, using that screenshot in the new view controller, and then popping the second view controller. The issue, though, is that it isn't a smooth transition; when the view controller pops, the keyboard in the picture disappears (since the picture was in the second view controller but has since been popped), but the actual keyboard hasn't reappeared yet. You see the keyboard sliding up just after the picture disappears. Is there anyway to prevent this such that the keyboard is just always there?
I don't have any other UITextFields in the new view controller, only the screenshot, a UIButton, UIScrollView, and two UIGestureRecognizers.
Thanks in advance!
I have a UIWebView in a modal view controller (using SVModalViewController). In iOS 4.2, when I tap on an input text field, the keyboard does not appear. The view animation where the page scrolls to make room for the keyboard still happens, but nothing appears. It works fine in iOS 5.
I am calling [self.window makeKeyAndVisible] in the application delegate, so that is not the issue.
Any guidance would be very much appreciated!
Solution: I needed to make the view controller containing the UIWebView the first responder, and after that, it worked!
I'm tying to pop up a modal UITableView with a search bar to allow the user to select an item. This is displayed from the flipside of an app created using the Utility template. I can display the UITableView fine, but although I can add a Search Bar and Search Display Controller component onto the the table in IB fine, when run the search is not displayed when the modal view is poped up.
Is this possible? Is there some restriction on using modal views with search?
EDIT: I got around this by changing the flipside view to use a navcontroller and showing the UITableView by pushing that rather than modal.
Can you post your code?
Also, what about having the modal view load the search view (a view within a view). That seems like a work around if indeed it is not standard behavior.
Looking for some guidance.
In my main window nib file, i have a tab controller where each tab control item is being loaded by a separate nib file and controller. One of the tab items is being loaded by a navigation controller.
Looks like this (excuse me for not including screenshot)
MainWindow.xib
Windows
UITabBarController
UITabBar
UINavigationController (loaded from Test.xib file)
TabBar Item
Test.xib
View
Now I like to add a scrollable text in the Test.xib. So that when the user clicks on the tab item, my Test view opens up with some text that the user can scroll.
Do I need to add a UITextView as a child of my View in Test.xib ?
Do I need to add a UIScrollableView ? And how would I connect them all so that I can manage the text.
If you add an UITextView to your view, connect it to a proper Outlet in your controller, than you can manipulate the text with setText:. The scrolling behaviour is added automatically.
Yes, UITextView needs to be a child of your View in Test.xib (you can add it programatically if you like or through IB). You do not need a UIScrollableView. The textview will scroll as long as you set scrollEnabled = YES;
Not sure what you mean by "how would I connect them so I can manage the text". You can send the UITextView a message of setText to whatever text you want in there. Hope that helps some!