Keeping UIStatusBar out of the layout before iOS7 - ios

In my iOS application, Status Bar is normally hidden (on start of the application too).
In some parts of the application I make it visible.
On iOS6 and iOS7 layout works perfectly and Status Bar overlaps any views on both iOS versions (I already want it to overlap, so it is OK).
However, I noticed that while on iOS6 and while the status bar is visible, if I rotate the device (my application supports every orientation), the layout is shifted down because of the Status Bar and I can not fix it after that point.
What am I doing wrong? How can I make it overlap the views on rotation change too?

The solution was obvious though it can be forgotten. (like in my situation)
self.wantsFullScreenLayout=YES;

Related

Fitting content to iPhone screen

I'm developing a kind of home automation app for iOS. I'm currently running into a spacing problem that I want to have a nice solution to.
The app is always showing a navigation bar and a tab bar, which is quite space consuming. This is a big problem on the current page I'm implementing, which is the Graphs page. In portrait, the spacing is decent, but in landscape mode, I feel like the graphs should be bigger and take up more space than in portrait mode, which is simply not possible with the tab bar and navigation bar.
So my initial thoughts here are if it's "allowed" to hide either the tab bar or navigation bar when in landscape mode (and keep them in portrait mode). What will Apple's reviewers think of this and what will the users think? Will they be confused? Do you guys have any other possible solutions to this?
I'm developing on a iPhone 4C which is quite small. I'm sure it wouldn't be a problem on the iPhone 6, but these small screens needs to be supported.
Thanks for some input on this.
It's absolutely no problem to hide bars in one mode and show them in another, there are a lot of apps that do it, especially when showing graphs.
Alternatively you could hide the bars after a few seconds, and show them again when the user taps the screen or scrolls around (see Safari mobile for an example).

iOS 8 rotation hides status bar, iOS 7 works fine

I have an app that I need to restrict one screen to be portrait only. I do this by always returning no in shouldAutoRotate. However, on iOS 8, when I rotate the device, it hides the status bar, but keeps the rest of the view locked to portrait.
In iOS 7, everything works fine. Nothing rotates when I rotate the device any which way.
I've tried disabling rotation system wide, and that works fine, so somehow, in iOS 8, the rotation separately checks for the views and then for the status bar to rotate (or maybe for the navigation controller, which includes the status bar? I'm not sure.)
Any help or ideas as to where to look to get my status bar to also lock to portrait in iOS 8 would be greatly appreciated!
Edit: So, it seems what is going on is that my VC is not rotating, its views are staying the same. However, the status bar orientation is changing from portrait to landscape. I'm figuring this out using NSLogs to check out the orientation, and even though shouldAutoRotate is returning NO no matter what, the status bar is still changing orientation.
Any ideas on how to stop the status bar from also rotating would be great!

Screen Shift on UIInterfaceOrientationLandscapeRight

I've got this application mainly displaying photographs.
The app was originally written for iOS 3.1 and upgraded to 4 before beeing published. It was not touched ever since. Now that the owner of the API appied some changes which ain't as compatible as they thought, I am forced to update the app. So I'll have to go for iPhone 5 and 6 and 6+ and iOS 7 and 8 updates in one go.
I observe this behaviour in the simulator of iphone 4, 5 and 6+ dimensions.
Portrait looks fine.
Landscape left looks fine too.
Landscape right is screwed up. Apparently it looks as if the whole screen were shifted to the left.
This is strange because I am not aware of anything that I would do different for landscape right or left. All I am doing is differnicating between any portrait and any landscape orientation.
It worked fine in the old version. But frankly I cannot reproduce this any more because I don't have access to the old xcode and sdk versions. But the app is in store for years and works fine on modern devices and modern OS versions.
A bit more background info, just in case it is of importance:
The app is based on a UITabBar, but it is not visible in this view.
The image is scrollable. It is placed on one view three times of the size of the screen with preceeding and succeeding image views place to the left and right respectively. This view with the three images is placed within a scroll view of the size of the screen or window respectively. This concept still works file, it is just shifted.
When I check the view item's frames in debugger or with NSLog, they all seem to be right, starting at (0.0/0.0) or respectively.
The view on the bottom with the four buttons that navigate to related functions and their view controllers, is re-alligned programmatically on each rotation, as well as the overlays with the textual information. All works as it should but it's shifted in this one orientation.
Well, all views are layouted programmatically on each rotation.
There are no constraints defined.
iOS6/7 deltas are all set to 0.
The app "wants fullscreen". By tapping on the image all UI items disappear and re-appear on the next tab. (Just by setting the .hidden attribute. Except for the navigation bar. Thats managed using setNavigationBarHidden:animated: with YES on animated) Works fine, even in the shifted view.
I am running out of ideas.
While I put all the details together for the question, eventually one idea came to my rescue.
The issue is related to hiding the tab bar. I could not use the regular way of hiding the tab bar because then it would not re-appear when navigating down to the functions that are associated with the buttons on the bottom overlay view.
Therefore I did some sort of hack. I did not hide it regularily but moved the tab bar out of the screen.
AND: This was the only thing that I did differently for landscape right and landscape left. I just searched for the constant names and found it.
Apparently, manipulating the tab bar view had a flaw in older iOS versions. (Or in older SDK versions, I am still working on that important detail)
To overcome the flaw the tab bar view was modified this way for landscape right:
[self.tabBarController.view setFrame:CGRectMake(0-kTabBarHeight,0,width+kTabBarHeight,height)];
This does not seem to make sense but did help me out a lot on similar issues years ago when the app was written.
Now, I changed this to:
[self.tabBarController.view setFrame:CGRectMake(0,0,width+kTabBarHeight,height)];
which is the same for landscape left too.
For the time beeing I separate between iOS versions >= 8.0 and smaller. But I'll double check that with older devices and may get back to this answer later.
I leave the question posted because I found the original "hack" here on SO too, so that I guess that others will have the same issues when updating to ios 8 or SDK 8 respectively.
Thanks for listening.

iOS 7 status bar supposed to overlap content?

I have recently updated my XCode to 5.0.1 as to be able to test my application on iOS 7.
Everything seems to be working as expected, but for some reason the status bar is overlapping the screen's content.
Now, I am still able to see the overlapped content as the status bar in iOS 7 is translucent, but it looks very weird.
I could always move my content down a bit to compensate for the height taken up by the status bar, but how would that look in iOS 6??
Is this intentional on Apple's part? Is there a standard procedure we as developers are supposed to follow to get this looking how it should?
Also, should I just add 20 pixels (or whatever the height of the status bar is) to the top of my view and just forget about iOS 6?
I have decided to just set my Top Space to: Superview to 20 (the height of the status bar) for all my parent views.
Looks good on iOS 7 but there is a 20pixel gap on iOS 6, and given the fact that 80% of our iPhone users have already updated their OSes to 7, I think it's safe to just assume that eventually everyone will be using iOS 7 and support for iOS 6 will no longer be needed.
I'm not gonna break my head anymore over this.
Thanks anyways!

Customized navigation bar buttons freezing after stand by

I am having a strange problem.I have used customized navigation bar(for which I have used another ViewController separately) in my project which has ofcourse navigation buttons.
As the device becomes active after stand by,it normally becomes active in portrait mode by default. And if we have held the device in some other orientation,it rotates to that orientation and every thing works fine. Even the navigation bar buttons.
Now here is the problem. If the device is held in Portrait mode after stand by,it freezes the navigation bar buttons. As far as I have concluded,this is because the application gets active in portrait mode by default and since the device is also held in Portrait mode,it can not find any orientation to rotate and hence freezes the buttons.Except navigation bar buttons,everything works fine.And if I rotate the device,like I have said,Everything works fine.
Dont have any idea,why this is happening.Can someone explain?

Resources