I have an iPad app who's login screen looks like this (top of image clipped because of sensitive info):
When the user taps "Log In" button I load a UIPopoverController with some buttons:
When the user taps "Email" button, I release the first popover and create another one with two text fields:
Looking good so far, but when the user selects the text field in order to enter text, both of the UITextField controls slide off of the top of the PopoverController, like this:
I am using storyboards/segues for these popover controllers, with a little hand coded stuff to handle device rotations. I am using Autolayout and both of the UITextFields are pinned to the SuperView Top and Leading edge. That is all.
If I move the buttons up more towards the top of the screen (out of the way of the keyboard), this behavior is still present.
What is triggering this and where can I override its behavior?
Did you set the ContentSizeForViewInPopover for the view controller in -viewDidLoad showing textfields?
[self setContentSizeForViewInPopover:CGSizeMake(200, 200)];
Related
Is there any way I can show a custom popup in the middle of the screen (over the current content) with buttons and a textfield and anything else I may need, entirely in interface builder?
If this isn't possible, then I don't mind doing it programatically.
I am guessing you create a custom view with the content but I am not sure how I show that view when a button is clicked and bring it up over the current view controller.
Thanks!
I would create a View and a Viewcontroller for it- set the alpha of the view to zero so its invisible - then but a nice picture as background for the custom popuop on it ( as background for the popup) on this i would put the buttons and the text label. Voilà - costum pop-up is ready to present with a segue (choose type over the current view controller).
I want to achieve something like this with my application and its keyboard.
http://www.youtube.com/watch?v=ajs1p5NCNw4 from 1:32 - 1:38.
How can you hide your keyboard by swiping it horizontally and show another view on its place? Is it possible with default keyboard or should I create my own view with few buttons which I'll need and then add the swiping? (I know how to do this, but I'm not sure if apple wouldn't deny the app in app store because I implement my own keyboard or something like that)
Those are custom views. It might be a scroll view with paging enabled and two subviews (the numerical keypad is one subview and items view is the other subview).
The app might be using the custom view in place of the system keyboard, by setting the inputView property of a text field for example. Or it might just be displaying the custom view as a subview of its top-level view.
My problem is thus: I've created a custom view, a numeric keypad, that I display when a button is pressed. When anywhere else on the screen is tapped, I want to hide the keypad.
I solved the problem by overriding touchesBegan:withEvent. Then a hit test tells me if the numeric keypad was pressed. As long as the keypad wasn't pressed, I hide it (by setting its hidden property to YES).
It works, but I don't like it. Its not very clean. My other option is to have a view controller for the numeric keypad and display it as a modal view controller. The keypad view would have a transparent background. I don't like this method either.
Any ideas?
A simple solution would be to have an invisible UIButton that you add to the view when the keypad comes up and remove along with the keypad when it is tapped.
Of course, the tap you get on the UIButton will prevent you from using that tap for anything else, so your interface wouldn't work while the keypad is there.
I have a UISearchBar which is subviewed by another view when a button is pressed. When it loads, it looks like the following (minus the red scribbles):
I would like to have the UISearchBar view be removed from the parent view controller when the tableView (the area with red scribbles) is clicked and is empty (no search has been made yet). I'm having a difficult time figuring out the best way to do this.
I have tried to put a transparent button in that section and add it as a subview to the search bar. However the button is underneath the tabl view area, so when the table view is clicked, the search bar loses focus and the uibutton is only then accessible.
Does anyone know how I can remove the search bar from the parent view controller when the empty table view below it is clicked?
Thanks.
To bring the transparent button up and make it catch all touched first, use [button.parentView bringSubViewToFront:button].
Another approach could be to catch the search bar losing focus (since you say you see that happening), by putting
– (void)searchBarTextDidEndEditing:(UISearchBar*)searchBar
in the search bar delegate, and handling it from there.
While in a call, if the user wants to use my application, and if the call finishes, and the user is still in the application, the toolbar moves up, well all the view moves up, and so the toolbar now has a space in the bottom. Basically the height "Touch to return to call" has. I am using a toolbar and a navigation controller. The navigation controller moves fine, and everything in the view moves accordingly, the only problem is with the toolbar. So the question is, Is there an event, which is called after the call is finished, so I can set the frame again of my toolbar? I tried this delegate with no luck:
- (void)application:(UIApplication *)application willChangeStatusBarFrame:(CGRect)newStatusBarFrame
This one is called only when the toolbar is changing orientation.
alt text http://is.hn/downloads/IMG_0008.PNG
alt text http://is.hn/downloads/IMG_0009.PNG
Thanks.
In general setting your auto resize masks properly should fix things. Could you update with a screenshot to show exactly where the resizing issues are happening?