When I minimize and maximize app in iOS 6 whole application view moves up by 20 pixel. (looks like ignoring status bar) But on iOS 7 its ok because status bar is overlaid on the application view.
I don't want app view to be moved up.
Can anyone explain what's happening?
I know that this is bad solution but I had no other way to do this :(
I just moved down main window by 20 pixel in applicationWillEnterForeground.
- (void)applicationWillEnterForeground:(UIApplication *)application
{
if(!iOS7)
[self.window setY:20];
}
This works good now : )
Hope this helps anyone : )
This worked for me:
I checked "Adjust Scroll View Insets" in the MainStoryboard Attributes Inspector and it worked.
NOTE: I'm using a UITAbleView embedded in a Navigation Controller embedded in a tabViewController. I "selected" the main TabBarViewController.
The screen doesn't hide behind the header anymore.
This link helped a lot: UITableView embedded in other view has wrong position of section header
Related
I have struggled to find a solution with the many similar questions and answers so I'm going to post my project here
My code does the following:
1) Creates a "container" view controller which is actually a scrolling view with 3 pages (left page, middle page, right page).
2) I just coloured the pages so you can tell the difference
3) The middle page has a view controller attached to it which contains a button
4) Pressing the button on the middle page will display a UITableViewController
5) Tapping the "Done" button should dismiss the UITableViewController
In portrait mode, no problems can be seen. In landscape mode, the UITableViewController pops up just fine with the correct (landscape also) orientation. However, when popViewController is called, this seems to make the device think that it is is portrait mode, so it rotates the tableview to portrait mode prior to the disappearing animation.
My view controller with the button is then also messed up because of this portrait change. If I rotate the device again, it returns back to normal.
This is a problem on both iPod and the iPhone 6.1 simulator for me.
Can somebody please have a look at my code and tell me what I'm doing wrong? (Big ask, I know, but hopefully that will also help somebody else out).
Thanks
I found the solution according to Apple's documentaton. If I create a separate portrait VC and landscape VC - as per the AlernateViews sample, it works correctly.
if we try to add view to self.window
[window addSubView:someviewcontroler.view];
why the view is hiden behind the status bar upto 20 pixel?
I found the solution to hide the status bar or set view.frame.origin.y to 20.
but I want to know why it hides.
Any reason?
That's no longer the way you'll want to show your root UIViewController. (it used to be, but it got changed a while back... possibly iOS 5? in iOS 4)
To prevent the issue try using
window.rootViewController = someviewcontroller
I have created a simple UIViewController, and set a UIWebView as a default view.
When I inserted it into a NavigationController, it did not show input method anymore if I click in some text field in page.
Any ideas?
input method = soft keypad,
ps: i set the simple UIViewController as rootViewController of MainWindow, also take no effect. can not show soft keypad too.
I just encountered this. For me, the keyboard is apparently sitting behind my web view. I happened to rotate the device (in the simulator) and noticed, during the screen rotation drawing process, that I could see parts of the keyboard behind my webview. [Quoted] [1]
Interestingly, I can't seem to reproduce this problem in a freshly created sample application - yet I can't see what the problem can be with my view hierarchy. [Quoted] [2]
[1][2]: Reference
Is your web view in a modal view controller?
Pls check if the userInteraction is enabled for the web view. If not you can set it by
yourWebview.userInteractionEnabled = YES;
I'm developing an iPhone app with Objective-C and iOS SDK with a tab view on the bottom. I want to make the app so that when it first loads up, the tabs are on the bottom, but none of them are selected. Instead, the user is presented with a "home" view, and can select the tabs from there if he / she desires.
How would I make this work? I'm assuming it's something in the App Delegate?
Thanks!
I did this recently. Just do
[self.myTabBar setSelectedItem:nil];
Works perfectly, no tabs should be selected. Let me know if you have any problems. Also, just put that in either - (void) viewDidLoad or initWithNibName .
I think this would be something that's appropriate to fake.
I would:
Add a subview that overlays the area normally occupied by the selected tab view.
Add UITabBarControllerDelegate tabBarController:shouldSelectViewController that will hide/remove that view.
The only remaining problem is to make the actually selected tab button seem unselected until the subview is hidden.
First of all, my code isn't complex - in fact it's just two sample programs from "Beginning iPhone Development: Exploring the iPhone SDK", combined into one program. I took the ViewSwitcher application, which switches between a blue view and a yellow view, and replaced the YellowViewController with the CameraViewController from the camera application.
I have three ViewControllers total. SwitchViewController just switches between BlueViewController and CameraViewController.
Inside CameraViewController, I'm trying to use a UIImagePickerController to choose an image. The picker is presented with presentModalViewController. The catch is that I want to do this in landscape orientation.
Everything works fine under 2.2.1, and everything works fine in 3.0 in portrait mode.
In 3.0 under landscape orientation, however, things break. If I set SwitchViewController to landscape orientation, my screen goes white when I try to present the picker. If I rotate the iPhone a few times, I can see a corner of the picker, which apparently was displayed off screen.
If I set CameraViewController to landscape orientation, the picker doesn't come up at all.
I think this page may have a clue when it says "The most prominent change [in 3.0] I can see is that the modal view controller will always use the application frame instead of the parent view controller's frame." I don't understand exactly what that means, though.
Any help is greatly appreciated. Thanks!
I believe what that means is this: Modal views always use the full screen, even if the parent view controller that invokes them controls a view that is only part of the screen. This makes sense for standard modal views like the camera picker, but I can see why someone who creates a custom modal view might want it to be smaller.
Not sure if that really helps solve your problem though.
Question -- what happens if you bring up the modal view and THEN rotate the phone?
You must have used addSubview in your parent view controller, try using presentModalViewController:.