Status Bar in IOS 7 - ios6

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

Related

iOS 7 Frame returns wrong height

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.

When does the UINavigationBar shadow show? (iOS 6)

I am using a navigation bar with a custom background image. When I wanted to add a custom shadow image, I was surprised to find that even the default shadow image is not visible.
iOS 6 introduced an automatic drop shadow on UINavigationBars, which I expected to see. The example project from http://www.raywenderlich.com/21703/user-interface-customization-in-ios-6 demonstrates this.
However, creating a new project from Xcode’s Master-Detail template does not show the shadow.
When exactly is the shadow shown, and when is it not?
IOS 6 automatic drop shadow is shown by default. If you want to disable/hide this shadow you can try this:
[[UINavigationBar appearance]setShadowImage:[[UIImage alloc] init]];
What I have noticed is that, if I copy/paste a viewController from one project to a new one, the UINavigationBar shadow (sometimes) it's not shown. Replacing the copied viewController with a new one solves the problem... (maybe your case)
I had the same problem on a project upgraded from iOS5, but only on navigation controllers inserted in the pre-iOS6 Xcode versions. Removing them and replacing them with new ones in the most recent version of Xcode (4.6) fixed the problem.
The workaround, which I found half a year later, is actually embarrassingly simple:
self.navigationController.navigationBar.clipsToBounds = NO;
This said, I still believe this is a bug with how Xcode 4.4/4.5 configures navigation bars in storyboards. But at least now we know how to work around it. Cheers!
In addition to Yang's answer, you can create a category to have a global fix like this
#interface UINavigationBar (JTDropShadowFix)
#end
#implementation UINavigationBar (JTDropShadowFix)
- (void)awakeFromNib {
self.clipsToBounds = NO;
}
#end
If you're looking for a solution without hacking around with the category methods, you can also get to a blog post that talks about how to use a UINavigationController subclass to achieve the same fix.
http://ioscodesnippet.com/post/61487770156/custom-shadow-image-on-navigation-bar-ios6-fix
to add some context: i just took my 1-year-old app Cocktailicious and embedded the root UINavigationView in a UITabBarController. after that the old UINavigationBar had the property Clip Subviews checked in interface builder.
in the embedding process i also added a second navigation controller for a new tab in the tab bar. surprisingly, this controller came with Clip Subviews unchecked. feels like an xcode issue.

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..

UIToolbar at the bottom not working in Retina 4 simulator

I know it sounds a bit odd but perhaps someone has experienced the same too.
If I have a UIToolbar placed at the bottom of a Retina 4 sized xib (548 size) it does not work in the simulator (buttons show no reaction). However if I place it a bit higher (not sure where the threshold is) they work again. ???
My problematic xib looks like this:
As mentioned elsewhere (e.g. iPhone 5 (4") bottom toolbar not responding ) the problem is that even though your view is the full height, the underlying UIWindow isn't, and the underlying UIWindow is involved in your view getting touch events.
If you have a file name something like "MainWindow.xib" in your project:
Open it in Interface Builder.
Select "Window" from the list of objects on the left side.
In the Attributes Inspector pane, click the "Full Screen at Launch" checkbox.
UI elements at the bottom of the screen should now work.
I found the problem being the UIWindow. (perhaps it is only a problem with older projects) As long as the window object it set to the 480 size actions falling out of its size (which can happen on Retina 4) are not recognized.

Weird Lag Bug with Internet Explorer 9 + Silverlight 4 + MVVM Light

I have a very weird bug when I try to debug when my silverlight application run under Internet Explorer 9 (RC). I use MVVM Light framework. (And I use a WCF WebService, but I guess this part isn't a issue)
I have two side effects/bugs:
When a breakpoint is hit and I pres F5, I have at least 5-8 sec of wait.(no reason).
Sometimes when I move my mouse anywhere my pc beeps (many short beeps) and my mouse moves very very slowly.
I run the same this on chrome or firefox without any problems.
I use MVVM Light Toolkit V3 SP1 (4).
Mb this http://mvvmlight.codeplex.com/workitem/7293 ?
Well anyway it seem that there is some "memory leek" or something like that... it dosen't crush IE but it gives a lot of trobles..
Try this. Create new empty project and try to add onle feature after another (one by one)... maybe this will help you to find where problem is..
I create a very small sample of this behaviour...
http://cid-9292b3e7504f952f.office.live.com/self.aspx/Public/MVVM%20Bug/MVVM%20Light%20Test%201.zip
Put beakpoint on this line ...
//TEST PUT Breakpoint here !!!!!!!!! each F10 take 3-5 sec ...
ListOfSample.Clear();

Resources