UIMenuController not appearing after change of view - iphone

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.

Related

Keep UITextField as first responder when pushing new view controller

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!

View is blank after modalViewController is dismissed

I am using PPRevealSideViewController and I am showing a ViewController modally after user taps a cell in a side view. When I dismiss a modal view controller, the view, where user tapped, is shown blank. Only after I move a little bit side view, it is shown again (refreshed). What might be the problem?
This was a side effect of your preload call on viewWillAppear or DidAppear in fact. The view should not be preloaded if shown. I added this behavior as default into the controller.
But the idea behind was to test if [self.revealSideController sideDirectionOpened] != PPRevealSideDirection from the side you are trying to preload.
Fixed right here https://github.com/ipup/PPRevealSideViewController/commit/a1ca242422f0a8b4666df5987ca4a020f869bb99

Keyboard won't appear in modal view controller

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!

Refresh View when Tab becomes active

I have a TabBarApplication for an iPad App, which is switching between two ModalViews (LoginForm / Memberarea) in one of the Tabs by checking Loginstatus. All works fine, but when I switch to another Tab of the Application and then switch back, no modal view is shown and the view don't refresh to check for status again.
Is there any way to keep the modal view on the TabView, even if user switches to another tab?
Or is it possible to refresh the View when its tab becomes active?
Would be great if someone can help me with this problem!
EDIT: Problem solved!
I solved it on my own. =)
The problem was: After switching to another TabView the modal don't show up, but is not dismissed. There was a error in my log displaying that the modal can't be viewed.
So to solve it I used the "viewWillDissapear" method and dismiss my modalView before switching Tabs, like this:
[self dismissModalViewControllerAnimated:YES];
The Modal is dismissed, and after switching the View loads again and displays the deserved modalView. =)
Thanks for your answers.
You can do the refresh code you were talking about by implementing viewWillAppear in your view controller
Call your code which clls modalview controller in viewwillappear method.

Present a UIView over a view

How can I make a custom view in iOS which appears above the existing view,but smaller? It should be like UIAlertView, but taken from a .xib file. After user taps a certain button, the small view vanishes and the normal view appears.
If this is posiible, how can I do it? And.. if it's not hard for you, please, include code.
Thanks in advance!
I think what you're looking for is a modal view. Modal views make it easy to have a view take over the screen for a little while, then when they get dismissed have the background view resume where it left off without having to worry about who's on top or handling events in partially-obscured views.
Here is Apple's article describing it.
They key is to have the controller class for your view call [self presentModalViewController:popupController animated:YES]; where "popupController" is the view controller for the view you want to show up. When you're ready to make it go away, call [self dismissModalViewControllerAnimated: YES];
You can just use the addSubview: method on your UIWindow or your visible UIViewController's view to show the UIView, and you can hide/remove it later by calling removeFromSuperview on the presented UIView.