ios7 - iPhone 5 giving white space at the top - objective-c

Client has come back to me on projects saying they see white space on the top (they can't see the default things like time, wifi signal, etc) at the top.
This is happening when they installed iOS7 on their iPad.
Any idea why this is happening?
Note:
I have navigation bar as image. I hide the navigation bar and put navigation bar as an image.
Downvoters
I know this is not a perfect question for SO, but I thought to ask to take inputs. Tomorrow I am going to study on it.

try to insert following code into your viewDidLoad:
if( [self respondsToSelector:#selector(edgesForExtendedLayout)] ) {
self.edgesForExtendedLayout = UIRectEdgeNone;
}
Otherwise you could try it, by removing the UIStatusBar. Select your Project, go to the section General and select Hide during application launch inside the subsection Deployment Info. Next you have to add the attribute inside the Info section called View controller-based status bar appearance and set it to NO.

It's due to the status bar.
In your XIB or Storyboard chose to view your xib as iOS 6 :
On your view, add a Content View (you will add your outlets elements inside this content view) and add a Y delta of 20 (for the status bar) :
Now, if you compile your app on iOS 7 or iOS 6, your view will go up or down and you won't have the space anymore.

Related

UI Tab Bar added to Storyboard not showing up when I build the App

I have an iOS App. I currently have an existing View Controller. I manually added a UI Tab Bar to it using the storyboard.
I added the UITabBarDelegate and implemented the corresponding functions required tabBar:tabBar didSelectItem:item.
I've also connected the delegate of the Tab Bar to the view controller itself.
However, when I build, the Tab Bar completely does not show up at all.
I know you can just use a Tab Bar Controller, but I need to add the Tab Bar to it, and use the Tab Bar to modify content of the view itself. (specifically it acts as a filter for a table view) So, it doesnt make sense to create 4 exact same Views to hook up to a UI Tab View Controller
What am I doing wrong?
I found out what's wrong.
It turns out, I had completely successfully implemented the UITabBar. What happened was that I was testing on an IPhone 4. As such, it bled out of the screen and could not be seen. Adding constraints fixed it.

Making a nav controller work the same in iOS 6 and iOS 7

How can a navigation bar be supported in both iOS 6 and iOS 7 with a UIContainerView via a storyboard?
I am updating an iOS 6 app to iOS 7, but want to continue to support iOS 6. I have a main top level view that is embedded within a UINavigationController. The view within the navigation controller has a container view in it. I am using a storyboard to lay out the view.
On iOS 7 the navigation controller uses the entire screen, and I've set it up to put the container view content below the navigation bar. In iOS 6 the content of the view does not go under the navigation bar, so I have a blank gap below the nav bar.
Normally I would just reset the origin of the offending view on iOS6 (in ViewDidLoad or somesuch) and go on my way. However since my content is in a UIContainerView, I can't seem to change the frame after it loads. (I have tried this in prepareForSegue: when loading the UIContainerView. I'm open to having done this wrong? heh)
The closest I have found is using the following code under iOS 7 to make the nav bar opaque and keep the content out from under it, then using the entire space for my UIContainerView.
// tell the view to not extend below this nav bar
if ([self respondsToSelector:#selector(edgesForExtendedLayout)])
self.edgesForExtendedLayout = UIRectEdgeNone;
This solution works but has the side effect of showing the status bar as black (since it's more or less "blank" under the status bar). Alternatively, if I put the top edge of the container view below the status bar, on iOS 6 I have a big gap below the navigation bar.
I can eliminate the use of a navigation controller, but that seems a bit heavy handed in this situation and I'd like to use that as a last resort.
I've found the solution to this.
You need to set the barTintColor in iOS 7, which also seems to color the main status bar, as well as setting the nav bar to not be transparent like this:
mainController.navigationBar.barTintColor = [SRPRTabletHelpers customUserColor];
mainController.navigationBar.translucent = NO;
The non-transparency was the key, while setting the color sets not only the regular nav bar, but the color beneath the status bar as well.
I also needed to change my containerView top edge to be the full height of my view contained within the navigation controller, now that it is not transparent, and it works the same on both iOS6 and iOS 7.
While you mention to have already solved this, your method seems to require a lot of manual code and if checks. The iOS 7 UI Transition guide, in the Supporting iOS 6 chapter mentions another way: first design your interface for iOS7 as you have done, with your view extending below the navigation bar.
Then, in the interface builder open the size inspector for UI elements and modify the iOS 6/7 deltas. These values are applied when the storyboard is not run on iOS 7. For example, in your case you can select all your visual elements, then set the Y delta to -44, which is the standard navigation height. That will make the UI go up on iOS6, compensating the fact that the view doesn't go under the navigation bar.

How do I fix empty 44px space in iOS7 view with ViewDeckController?

I am in the process of transitioning an app to iOS7. All of the views throughout the app have a 44px empty space at the bottom that appears to be for a bottom toolbar or something, but I am not trying to display a bottom toolbar. This space also exists on views that do have a bottom toolbar and the toolbar just shows directly above it.
The red space shown is actually a view behind the black view. No matter what size I set the frame of the black view to, the red space is always shown. I am also hiding the status bar in plist, so don't know if this is an artifact from that or if it has something to do with navigation bar as they are both normally 44px in height.
I have looked at the transitioning guide and haven't found anything that's worked. Any ideas to what could be causing this and how to fix?
UPDATE:
I have tried setting edgesForExtendedLayout = UIRectEdgeAll and extendedLayoutIncludesOpaqueBars = YES (also tried NO) with no effect. When I look at the subviews of the navigation controller it shows a UIToolBar as hidden, but shows it contains a frame in the exact area the view refuses to resize to even with autolayout constraints.
UPDATE 2:
This is actually a problem with ViewDeckController (https://github.com/Inferis/ViewDeck) and the way it sets it's center view bounds.
I believe it has to do with the UINavigationBar. Try toggling the following options in Storyboard and see if it solves the problem. Namely, the 'Extend Edges' options:
These options can also be set in code with the edgesForExtendedLayout and extendedLayoutIncludesOpaqueBars properties on UIViewController.
If you are transitioning to iOS 7, you should be using an Auto Layout constraint to anchor to the Bottom Layout guide. Control drag from your view to the Bottom Layout guide and choose Vertical Space from the popup menu.
Using frames in iOS 7 is harder and is the way of the past.
Auto Layout is hard to grasp at first, but it is very powerful once you get the feel.
This is actually a problem with third party library ViewDeckController (https://github.com/Inferis/ViewDeck) and the way it sets centerViewBounds for IIViewDeckControllerIntegrated. I was able to figure it out after changing to IIViewDeckControllerContained and seeing the view sized correctly.
In IIViewDeckController.m, just return self.referenceBounds for iOS7 like it does for IIViewDeckControllerContained.

Tableview not using all available space

I have an IOS application containing, amongst other view controllers, a view controller with a UIScrollView and UITableView. This is launched with
self.storyboard instantiateViewControllerWithIdentifier.
I hope this maybe something simple, but I cannot get the table view to use all its available space, i.e. the UITableView has enough height for say 4 rows, but it starts to make use of scroll bar when there is only 3 rows in the table.
Regarding the scrollview, I have some horizontal content which is only 25 in height, but if I make the UIScrollView anything less than 110 in height or so, then the horizontal content will only appear partially on screen or not at all.
Xcode 4.4.1 on OSX Lion, IOS 5.1
Any help will be appreciated.
Fixed the problem myself (Trying to find a host to put some screenshots. Will update).
I set the Bottom Bar from Inferred to Tab Bar in the Attribute Inspector and it now works. Both the previously unusable spaces in the ScrollBar and the TableView can now be used. These space were both of the size of the Tab bar. Took a while to work this out, as even before this change, the tab bar was showing on the simulator, so I didn't think it was Tab Bar related.

Autoresizing different between ios 4.x and 5.0

Been trying to figure out why this happens for a few days.
My app is supposed to have a shared view between all screens that handles navigation. So I made a nib for the navigation with a few buttons on it and added that view to the window (which I'm told is a bad choice)
This global view stores 4 navigation controllers so that users can swap between them without losing their place (much like how a tab bar works). But it looks as if adding the view to the window has affected the way my app resizes for the in-call status bar. In 5.0 the entire app works perfectly, but in 4.0 it's completely wrong.
On 4.0 if I enable the in-call bar on a screen it will not move at all.
If I push a view controller with the in-call bar the navigation bar appears at the top, but the view appears 20 pixels lower than it should
And if I have the in-call bar enabled, push a screen, then go back, the navigation bar moves down 20 pixels (as it should), but the view stays where it is and is clipped by the navigation bar.
What is happening on iOS 5 that isn't happening on iOS 4.x that makes these changes? the app is all buggy on 4.3.
Create a "dummy" view controller (UINavigationController works well). Then add your view to that. Without using a view controller hierarchy events will not be propagated correctly.
I suspect this works on iOS 5 because of the new "container" view controller system. They have moved the system to be more lenient in these areas. I can't give a more specific answer than that without seeing your entire app navigation design.
EDIT:
Also try using the wantsFullScreenLayout property. It may help.