iOS 7 content shifting up by 20 points due to transparent statusbar - ios

Ever since I have upgraded to iOS 7, all my content have shifted 20 points up, and I cant seem to get this fixed. I have looked elsewhere on ways to shift the content down, from adjusting the window, to the view, but none seem to affect the content views.
Can someone please tell me what to do to get the views shifted down.
Here are some screenshots:
Notice the window red background colour showing through at the bottom:
Notice how the pattern repeats at the bottom of the login page:

If your project doesn’t use Auto Layout, issues caused by the status bar differences between iOS 6 and iOS 7 can be resolved by using Springs, Struts, and iOS 6/7 Deltas.
Solution for you is to move the content down by 20px but the content wasn’t under the status bar in iOS 6.
To remedy this, use iOS 6/7 Deltas to set a negative Y Delta, equal to the number of points that we moved the content down for iOS 7. For example, if we moved content down 20 points for iOS 7, then we set a Y Delta of -20 points.
Follow this link
to get the correct direction as per your code.
Hope this will help you a lot.
Good Luck.

Could be the result of the translucency in iOS 7. Can you try the code below in your ViewController
-(void)viewDidLoad {
[self.navigationController.navigationBar setTranslucent:NO];
}

Related

Issue with Safe Area - Fine on iPhone X, not on others

So I'm trying to update my app for the iPhone X (a little late to the game, I know), and I enabled safe area, and fixed (supposedly) all my constraints to match. It looks perfect on the iPhone X. But for some reason, on all other iPhones, it still accounts for the iPhone X's notch, despite Safe Area correctly displaying where the UI should start and end. I'm at a loss. None of the constraints in question are hard coded, I set them all to the "standard" value (or so I believe).
storyboard (first button is actually the talk bubble, which is just a static image, second is the paw print, which is an actual button)
messed up iPhone 8 (bubble and ui elements should be at very top and bottom)
Here's my storyboard file: https://ufile.io/35zvs
UPDATE: image for ercell0
You are using standard spacing for top and bottom for your Banner View with a required priority. try setting this to superView: 0 or safeArea: 0 and see if that corrects the issue for you.
The updated view:
Can you change ViewAs from iPhoneX to iPhone8, and attach an image?
Other iphones your are testing on are running iOS11 or older?
If running older versions, safe-area won't be able to help with the alignment. For pre iOS11, use the constraints you were using previously or Layout Anchors.

Status Bar Issue for Auto Layout in ios sdk due to missing Delta Property

My apps contains various xibs(Not Using StoryBoard), I am using Auto Layout to adjust view to support various devices.
The problem is on iOS6 my views leaving 20 pixel distance for status bar, since this has changed in iOS7. I searched on net and came across approach that by adjusting delta we can overcome this issue, but this will not work when we use Auto Layout, and I do not want to change it through code so is there way to handle this issue using interface builder also?
Thanks in advance!
I also searching for set the Edge Inset Uncheck but It is also not found in the Attribute Inspector Window as shown below.
Is there any way to add a Top Layout Guide in xib?
What can I do for solve this?
See these:
iOS 7 status bar back to iOS 6 default style in iPhone app?
iOS 7 - Status bar overlaps the view
https://stackoverflow.com/search?q=ios+7+status+bar

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!

Default UIProgressView rendering on iOS7 using iOS6 SDK

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.

UIView not resizing correctly with UINavigationController in iOS 7

I encountered a strange behaviour of a view in an iOS 6.1 app which I tried ran with the iOS 7 beta 2 and on my iPhone.
This app has a UINaviagationController which works fine if I run it in the iOS 6.1 simulator. However, with the Xcode DP the bottom part of the view is cut off. See picture.
Does anyone know how to fix this? I am drawing the box that you see as cut off on the bottom (self.frame.size.height) of the UIView which is managed by the navigation controller.
Thanks.
try subtracting the size of the box by the amount of the toolbar at the top. When using the self.frame.size.height, it will use the entire height as the location on the view, so when subtracting by the toolbar/navigation bar, it will raise that up just enough to fit the entire box onto the view
//clearly not objc but its just to show you how to implement it
boxLocation at (self.frame.size.height - (amount of toolbar/nav bar))
Hope this helps!

Resources