My app is compiled against iOS 6 SDK (haven't gotten the time to upgrade to iOS 7 SDK). So I just noticed that the Default image is overlapped by the status bar. This seems to happen only in the "multi-tasking" view but not when resuming my app from background for some reason.
See this image:
I don't think many people will notice this at all.
However, as far as I know you could possibly disable the Statusbar when the app gets in backround.
To do this just use this method in the delegate:
- (void)applicationWillResignActive:(UIApplication *)application {
//code to disable statusbar
}
In the applicationDidBecomeActive method you could enable the statusbar again.
- (void)applicationDidBecomeActive:(UIApplication *)application {
//code to enable the statusbar
}
Furthermore you can take a look at this previous asked question: Status bar won't disappear
If you got any questions feel free to ask!
edgesForExtendedLayout does the trick for iOS 7. However, if you build the app across iOS 7 SDK and deploy it in iOS 6, the navigation bar appears translucent and the views go beneath it. So, to fix it for both iOS 7 as well as for iOS 6 do this:
self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
if ([self respondsToSelector:#selector(edgesForExtendedLayout)])
self.edgesForExtendedLayout = UIRectEdgeNone; // iOS 7
Related
I started making updates to my app today. When I launch it in iOS Simulator (running xCode 4.6) the status bar is not visible during app launch (this is how I want it set, and how my app is setup in xCode) but then it is also not visible when I get to my Tab Bar Controller view and all my UIViewControllers (I have a tab based nav app).
The problem this creates is that the UIViewControllers, when displayed on a 4-inch display in iOS Simulator, it creates a small white space above the bottom Tab navigation bar (the height of which matches a status bar). I tried reverting my app to a previous backup but still can't get this fixed.
Help is appreciated. Thanks!
Using latest version of xCode (4.6)
iOS SDK 6.1
Try putting this when you want the status bar to reappear:
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
Hope this solves it.
OK write this line: [[UIApplication sharedApplication]setStatusBarHidden:NO];
in your appdelegate.m class under this method: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions & then check.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Autorotate in iOS 6 has strange behaviour
I have issue with IOS 6, the display show up as portrait and not as landscape.
I am using both real and simulator device, if I build the game on 5.1 simulator the view is properly presented if I am using simulator version 6 or the real device with version 6 the view is get portrait view.
Here is my code.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
if( interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
interfaceOrientation == UIInterfaceOrientationLandscapeRight )
return YES;
Any idea how to solve such issue?
Thanks
ER
ShouldAutoRotation does not work anymore for iOS 6. Use supportedInterfaceOrientations instead.
You can get more information here: http://dhilipsiva.blogspot.com/2012/07/ios-6-ui-interface-orientation.html
Hope this helps.
The method shouldAutorotateToInterfaceOrientation has been deprecated for iOS 6. It has been replaced with the following:
- (BOOL)shouldAutoRotate {
return YES;
}
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscape;
}
Also, there's a VERY important detail to make this work. In your AppDelegate, make sure you change the following:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[self.window setRootViewController:<your main view controller here>];
}
If you're using [self.window addSubview:self.mainViewController.view], it won't work.
If you want to support iOS 5 as well as iOS 6, leave shouldAutorotateToInterfaceOrientation in your code; just know that it won't be called on iOS6 devices.
The example #Simon gave should be able to coexist peacefully with your original code, with either operating system calling its applicable method. I was able to implement something similar in my app, but I used the project settings to set up autorotation for iOS 6 and just left my shouldAutorotateToInterfaceOrientation alone to make the app compatible with iOS 5 too.
I have a popover in an app and it doesn't resize to what I set. I found this but it still doesn't work in iOS 5.1. I switched to the ios 5.0 simulator and it worked again. Am I missing something?
EDIT
In viewDidLoad:
self.contentSizeForViewInPopover = CGSizeMake(320.0, 137.0);
In viewDidAppear:
self.popoverController.popoverContentSize = CGSizeMake(320.0, 137.0);
Looks like it has to be a "bug" or a change in iOS 5.1. Apple's sample code does not do a popover in a splitview. I have disabled the swipe gesture though by calling setPresentsWithGesture on the splitViewController. It is annoying swiping and having the master view come up.
I created an app in Xcode 4.1 and now i upgraded it to 4.2 so i could use the iPhone 5 simulator.
I have an app that uses a tab bar to loads 3 views. They load correctly in iPhone 4 but in iPhone 5 simulator that doesn´t happen. I´m able to see my xib (with no content) that i load initially, but there are no tabs to choose from.
Apple made some changes in the projects in Xcode 4.2. Now they have storyboards which i don´t have because i created the app in Xcode 4.1. Anyone knows a work-around this?
The only code i think it may be usefull..
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[window addSubview:montraViewController.view];
[self.window makeKeyAndVisible];
return YES;
}
I was loading the view in viewDidAppear, that method was triggered when the view appeared in iOS 4 but in iOS 5 that didn´t happen. So i changed my "load controls" to the method viewDidLoad and they loaded correctly. Don´t take this has a bug, because it´s more probable to be bad programing.
For the past few weeks I have been working on an app that uses a SoundManager class that I found via the comments of this blog post:
http://www.gehacktes.net/2009/03/iphone-programming-part-6-multiple-sounds-with-openal/
The link to the SoundManager and tester app is provided in the comments by David Evans. I am not allowed to provide a second link so I'll mention the name of ZIP file he links to:
SoundTester.zip
I was very happy with this code, until iOS 4.2 was released. After updating my iPad and Xcode correspondingly, my apps that use the SoundManager class only show the navigation bar with it's title. The rest of the screen is white. It's not iPad specific behavior. I have seen the same on an iPhone4 and an iPhone 3G that upgraded to iOS 4.2.
When running the apps in the simulator, I get the same results. The problem is that I get no error messages in the console window and no build and compile errors at all. Very frustrating and very hard to fix for an iPhone developer that started using the iPhone SDK only months ago.
Does anyone have a clue what could have gone broken and how to fix it? Any help is appreciated!
Somebody please shoot me...
Just found the problem, with the help from a piece of code I had written down from the iPhone Developer's Cookbook.
The problem was not the SoundManager (which still works fine, fortunately!) but in the application:didFinishLaunchingWithOptions: method in the App Delegate class.
Here is the code that causes the problem in iOS 4.2 but still works in iOS 3.2:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Create a Navigation Controller on the fly.
// Use the View Controller as root view controller.
viewController.title = #"ThreeSounds";
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:viewController];
nav.navigationBar.barStyle = UIBarStyleBlack;
// Add the view controller's view to the window and display.
[window addSubview:nav.view];
[nav release];
[window makeKeyAndVisible];
return YES;
}
The solution: remove the line that says: [nav release].
For some reason, releasing the navigation controller was not a problem in iOS 3.2.
In iOS 4.2 is makes the screen go white.
I found out that this method was the problem because it was the last method that was executed. That, in turn, I found out by adding this piece of code to every class in my project:
-(BOOL) respondsToSelector:(SEL)aSelector {
printf("SELECTOR: %s\n", [NSStringFromSelector(aSelector) UTF8String]);
return [super respondsToSelector:aSelector];
}
This piece of code logs all the methods that get called.
I used the following code in - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions method
window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
if (!window)
{
[self release];
return 0;
}
This method caused white screen when I launched my app. It was OK in 3.2 / 4.0 SDK. In SDK 4.3 it is causing the problem. Just comment or remove this code if you have it.
I had same problem. The problem was duplicated UIWindow.