I'm struggling with an issue using constraints under XCode 5.
I am building my app for iOS7 while trying to keep iOS6 UI compatibility.
I am currently facing one UI issue using Interface Builder.
I have a table view that adjusts according to the height of the superview using the constraints (set in Interface Builder).
It works perfectly under iOS7.1 portrait and landscape orientation.
My issue is that running on iOS 6.1, the views shrinks/enlarges depending of the superview height, BUT it goes 20pixels more on the bottom. It clearly is because of the status bar.
It doesn't make sense to me , since the autolayout should take care of this , right ?
I've tried to look for solutions here obviously, but i always find ways to go from iOS6 to iOS7 while preventing the view from showing under the status bar. It doesn't quite apply to my issue.
Any help on how I could/should solve this problem ?
Thx
Update the UIVIEW Frame programmatically when its ios version < 6
if ([[[UIDevice currentDevice] systemVersion] floatValue] < 7)
{
// Update frame
}
else
{
//Update the frame in UI
}
or check the below link, maybe its helpful
iOS 7 status bar back to iOS 6 default style in iPhone app?
Related
I Have Developed an Application. In that one i Added a GMSMapView and also Two Buttons at the Bottom. If i run this Application on iOS Simulator Version 7.0 all the outlets on the XiB are Visible. But If i run this Application on iOS Simulator Version 6.1 one of the Button is not Visible. Can any one please tell what is the Reason why it is hiding one button if the Height of the Device is Same.
You can use delta value that will effect the layout for the ios 6 not to the ios7
if you are set view as ios 7 in interface buinder you need to decrease you y position show image below
-64 delta y because you use navigationbar at top so it's size 44 and +20 for status bar
I am having trouble getting my table view to size correctly on 3.5 inch iPhone between the two iOSs.
I have a tabbar (native). I cannot use auto layout because its not compatible with iOS versions < 6.0. So Xcode tells me.
If I size for iOS 7 it gets cut off by the tab bar so i move it up but then it is in the middle of the screen for iOS 5. and visa-versa. Not to mention when I go and try it on a 4 inch screen.
The Autosizing Attribute in Xcode IB seems to be no help either. (Not the checkbox the lines)
In the pic below this is set for iOS 7 running it on iOS 5. If I move it to the bottom of the black, which is not the bottom of the screen, it will be underneath the tab bar when ran.
I have played a round for some time with different configurations but I cannot seem to hit it right. What am I missing?
You have 2 choices.
Either set the tab bar translucency to NO
if ([self.tabBarController.tabBar respondsToSelector:#selector(setTranslucent:)])
[self.tabBarController.tabBarController.tabBar setTranslucent:NO];
or put this in your viewDidLoad in your controller
if ([self respondsToSelector:#selector(setEdgesForExtendedLayout:)])
[self setEdgesForExtendedLayout:UIRectEdgeNone];
I started a project with Xcode 4, and today I updated my Xcode to 5. Running the same project in iOS7 simulator revealed some interesting (also frustrating) issues.
So my app has a sidebar that the user can tap on, and based on which button they tap on, I would instantiate a new VC using this code
YMGeneralInfoTableViewController *generalInfoTableVC = [self.storyboard instantiateViewControllerWithIdentifier:#"generalInfoTableVC"];
Then push this new VC onto the nav stack with this code
[self.navigationController pushViewController:generalInfoTableVC animated:YES];
Everything worked fine in iOS 6. However, in iOS7, the navbar magically disappears.
Here's a screen shot before pushing new VC
Here is after pushing it:
As you can see, there is a gap between where the content starts and the statusBar, in the position where the navBar should be.
I also tested out this code again on my iOS 6 device, everything is still fine on that iOS 6 device. So I am not sure what's going on here.
Also if I try to log the navBar/navigationItem of the controller where the navbar disappeared, I do get the correct reference to the navBar, which means that it is not nil, but simply not showing.
However, the methodsetHideNavigationBar:NO Animated:NO didn't bring the navBar back either. Does anyone know what's going on?
By the way, I've found the solution for this.
It is because in AppDelegate, you might already set some of appearance changes for the Navigation Bar.
So what I suggest you to do is to check the device OS first before set custom apperance for Navigation Bar?
- (BOOL)isOS7
{
float currentVersion = 7.0;
if ([[[UIDevice currentDevice] systemVersion] floatValue] < currentVersion)
return NO;
return YES;
}
So if return "NO" then only you do whatever possible that can be use for
Checkout Autolayout constraints,
I have tried same by using iOS 6 and iOS 7, my navigation bar is showing. Still checkout Autolayout constraints, i have doen it without autolayout
I am experience a rendering bug when using the default progress view. Rather than being 9px tall, the view is clipped to about 4px when using the default progress view. My app is built with the iOS6 SDK, and the issue appear when running on a iOS7 device. The interface is built with interface builder.
Is there a simple fix for this issue? Switching the style from "Default" to "Bar" in interface builder fixes the problem, but that changes the appearance.
Setting the frame in code helped me solve this.
#iPP 's answer is not the best. Setting the frame in code will cause your code to be riddled with iOS version checks, and that code tends to get very complicated when supporting multiple device orientations.
I think the best way is to use new feature "iOS 6/7 Deltas" in Xcode 5.
And "iOS 6/7 Deltas" key usage is:
When Auto Layout is turned off, you will notice an area in the sizing tab of the utility area (right pane) of Interface Builder that allows you to set iOS 6/7 Deltas. Deltas can be set individually for each view and work as you would expect. If your storyboard or nib is set to view as iOS 6, then setting the deltas will cause that view to be shifted and/or resized by the set delta amount when run in iOS 7. Alternately, if your storyboard or nib is set to view in iOS 7, then the deltas will be applied when run in iOS 6. Both of these tools help you to support older versions of iOS alongside iOS 7
for UIProgressView, here you can try to set "delta Y" to be -7px, because iOS 7 just reduce the Y origin of UIProgressView by 7 px, so when running in iOS7, we should give it back the 7px.
It's like the iOS7 cut the progress view use the iOS7 Style's frame.
You have two ways.
1. set the progress view style ---bar, you can do this in the nib file or code.
2. use the code to set the frame. Something like:
progressView.frame = CGRectMake(x,y,w,h);
The second will face the layout issue when you rotate or change the layout.
So the easiest way is set the progress view's style.
I'm updating my app to iOS7 and I noticed that I had to re-adjust all my manually placed UINavigationBars so that they come under the status bar.
Now that all bars have been manually moved in the IB below the status bar I've a problem that it looks great on iOS7 but in any other version there is a pronounced gap between the status bar and the UINavigationBar.
Could anyone advice me why is this problem happening between iOS versions and how to overcome it?
iOS7
iOS6