iOS 7 Frame returns wrong height - ios6

I just stumbled across a weird issue when testing my app with Xcode 5 and the iOS 7 SDK. For some reason self.view.frame returns the wrong height for my view in viewWillAppear.
Testing in Xcode 5 with 4 inch retina iPhone simulator returns {{0, 0}, {320, 568}} although my UIViewController is embedded in a UINavigationController.
Testing in Xcode 4 with 4 inch retina iPhone simulator returns {{0, 0}, {320, 504}} which in my opinion is the correct height when wrapped in UINavigationController.
I made the tests with a naked single view controller project with storyboard.
Any ideas? When somebody needs further information - just ask - I will provide it as soon as possible.
Cheers.

If you remember the WWDC videos - views now run under translucent Navigation bars and the status bar, so you would expect the view to be the full height of the screen.

Related

Status Bar in IOS 7

So it's well known that the UIViewController view goes under the status bar. My GUI is developed entirely programmatically, so none of the posts that I found on SO solved the problem for me. In particular,
if ([self respondsToSelector:#selector(edgesForExtendedLayout)])
self.edgesForExtendedLayout = UIRectEdgeNone;
does nothing whatsoever!
Question: is there a setting or a command to make my GUI in IOS 7 work just like it did in IOS 6: the UIViewController view goes right under the status bar (20px down from the top of the screen).
Many thanks in advance,
Sam

zoomToRect fails consistently for certain websites in iOS 7, but works in iOS 6 consistently

In iOS 6 and iOS 6.1 the code below works as I expected for all websites, which is zooming in on a portion of the UIWebView somewhere close to the middle of the screen.
In iOS 7 zooming works correctly the first time, but after the first time, zooming occurs on the top left corner of the screen, which is not where the x and y coordinates of the rectangle are located (supposed to be around the middle somewhere). In certain websites zooming consistently fails with iOS 7 after the first time, while in others it works correctly every time in both iOS6 and iOS7. This problem never occurred before in iOS 6.
UIScrollView *myZoomView = [[myWebView subviews] objectAtIndex:0];
[myZoomView zoomToRect:CGRectMake(380, 490, 165, 50) animated:YES];

iOS6 vs iOS7 font rendering issue

I've got a really strange font rendering issue. In my app I am using a cutom font "Bariol". When you look at the screenshot comparison between iOS6 and iOS7 you'll see that first the spacings (line spacing and also letter spacing) differ between iOS 6 and 7. But what is really weird is that the small letter "g" is different. The one on iOS 7 is actually the correct letter. I only noticed now that I am building with Xcode 5 that in iOS 6 the system was always substituting that letter.
Does anyone know why the letter substitution would happen under iOS6, and which font the OS is choosing?
Can I enforce the same letter/word/line spacing in iOS7 as in iOS6? Because some screens look off with the new spacing.
Your "g" is being replaced by the default Helvetica font in iOS6, but no idea why.

iPhone 5 specific screen size issues

I'm working on app and need to support iPhone 5's 4 inch screen sizes. I initially designed the app and ran thru the XCode 4.6 simulator targeting iPhone 3.5 inch (retina and non retina displays) and switched to iPhone 5 from within the simulator. To my surprise, I was seeing a 1 inch space at the bottom of the screen beyond my several UIButtons. I have to scroll on the iPhone 5 simulator to view my UIButtons. What should I do here to support all screen sizes and make it look identical on all devices?. Also, my app only supports portrait mode for all devices (including all revisions of iPad) and I'm not using storyboards at all.
Please help.
You can't make the 3.5 inch screen and the 4 inch screen look identical because they are not. But you can make it look better on both. It's hard to tell what problem you're having without seeing the code. But I'll take my best guess to help you out.
If this view is part of a viewController that you've added as the rootViewController, then it should take care of expanding itself to fill the full screen, no matter what size the screen. However, if this is a subView within a viewController's view, then you should ensure that the view takes up the full screen. Often people hardcode the frame of the view to arbitrary numbers like so:
[view setFrame:CGRectMake(0,0,320,460)];
However, that is not portable between 3.5 and 4 inch screens. You want to do this:
[view setFrame:self.view.bounds];
[view setFrame:self.view.window.bounds]; //sometimes i use this instead
//set autoresizing
view.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;
Apart from that, you can also use autoresizing to anchor components to the bottom of the screen, or to resize along with height of the screen.
See this post for how: How can I stretch and anchor a central view between a fixed-height header and footer, using Interface Builder?

Black Screen on top on initial launch xcode 4.5 ios 6.0 simulator

Black screen on top is seen on launch. It seems the view goes down. It is a project developed in xcode 4.4 and after upgrading to xcode 4.5 shows black screen on top moving the total view downwards. The status bar though remains in the right position. Is it a iphone simulator bug?
That Black screen appears when is application launches is called as Splash screen.
When user run the application, it will show the splashScreen after some time it will automatically remove from the Screen.
There are different sizes and naming conventions for iPhone and iPad.
On the iPhone one Default.png file was adequate, with the iPad one needs to anticipate the device being started in any orientation, including upside down.
iPad Launch Image Orientations
To deal with various orientation options, a new naming convention has been created for iPad launch images. The screen size of the iPad is 768×1024, notice in the dimensions that follow the height takes into account a 20 pixel status bar.
Filename, Dimensions
Default-Portrait.png * (768w x 1004h)
Default-PortraitUpsideDown.png (768w x 1004h)
Default-Landscape.png ** (1024w x 748h)
Default-LandscapeLeft.png (1024w x 748h)
Default-LandscapeRight.png (1024w x 748h)
Default.png (Not recommended)
Actually this happened because of hiding the navigation bar after
[self.window makeKeyAndVisible];
[self.navigationController.navigationBar setHidden:YES];
So solution is
[self.navigationController.navigationBar setHidden:YES];
[self.window makeKeyAndVisible];
I think this is a bug in ios.
Hope this helps someone..

Resources