iOS 7 Status Bar mixing in with view [duplicate] - ios

This question already has answers here:
Status bar and navigation bar appear over my view's bounds in iOS 7
(20 answers)
Interface Builder: What are the UIView's Layout iOS 6/7 Deltas for?
(6 answers)
Closed 9 years ago.
I am creating an application that will work in both iOS 6 and iOS 7. I have a view with a header image at the top. In iOS6 it works fine as it doesn't cover or interfere with the status bar at the top of the screen. However, in iOS 7 the view mixes in with the status bar and it looks terrible. I would need to know how to rectify this without it affecting iOS 6?

Select your view containing elements in Interface Builder.
Select Size Inspector tab from right menu.
in iOS 6/7 Deltas, give -20 in Delta-Y and 20 in Delta-height.
NOTE: not applicable using Auto-layouts.

Related

IOS Swift Status Bar and Navbar strange space top after update to Xcode 11 and swift 5 [duplicate]

This question already has answers here:
Presenting modal in iOS 13 fullscreen
(27 answers)
Closed 3 years ago.
I have a problem after updating to Xcode 11 & Swift 5 (Screenshot below).
My ViewController always has strange top space.
Is this a bug? If so, how to fix this ?
It is not caused by Swift 5.0, but rather the framework. Starting iOS 13.0, all the modal presentation are default to that kind. One way to get that to the old default is to set your modal's presentation type to .fullScreen. If you're using Storyboard, you can get it done like so:

Swift - Navigation Bars [duplicate]

This question already has answers here:
ios 11 custom navbar goes under status bar
(5 answers)
Closed 5 years ago.
I am having trouble making it so that the navigation bar will have an optimised display for both the iPhone X and all other iPhones and iPads.
I have read on the apple developer documentation that the navigation bar is meant to adapt so that the title is not hidden by the sensor housing on the iPhone X.
I have therefore tried making a navigation bar as normal on an iPhone 8 on the Interface Builder (and adding height 65 constraints, as well as top, left and right attachment constraints).
When I run in the simulator, the iPhone X shows the navigation bar through the sensor housing, thus meaning the title isn't visible.
Any help on how to get navigation bars working for all iPhones and iPads and the iPhone X at the same time would be much appreciated.
Thanks in advance :)
As of iOS 11 you are supposed to be using the new safe area guides to position your content. Do not assume a bar size as an offset from your view. See the apple documentation on Positioning Content Relative to the Safe Area

Xcode Resizing iPhone 5 app for iPhone 4 [duplicate]

This question already has an answer here:
Convert app from iPhone 5 to iPhone 4 device
(1 answer)
Closed 8 years ago.
I have successfully created and tested my iOS app for iPhone 5 screen size. I have disabled Auto Layout in my storyboard because I have created custom subviews. What is the easiest way to make it compatible with older device screen sizes (like iPhone 4/4s)? Do I need to re-enable Auto Layout? What is the traditional method of making iOS apps with dynamic screen sizing?
You can use property autoResizingMask of UIView to do declare the autoresizing for views you want it changed dynamically.

How to make .xib files compatible to both iOS7, iOS6 and earlier [duplicate]

This question already has answers here:
Status bar and navigation bar issue in IOS7
(11 answers)
Closed 9 years ago.
I am using .xib files in my app and I am using xcode5.
If I run my app in iOS6 and earlier, the alignments are missing.
Any one know about this issue?
Do we have to create separate .xib files for iOS7 and iOS6?
EDIT: I turned off Autolayout but under iOS6, the views are still going down by 20 pixels.
If you haven't done so already, turn off AutoLayout in your xib files. Autolayout only came in with iOS 6 and newer iOS versions.
Also, you can preview what XIB files look like between iOS 6 and iOS 7 via a popup menu in the File Inspector:
in iOS7, the app windows starts from y=0px (in iOS6-, it begins at y=20px).
The quickest and easiest way to handle this, (and since you're already using Xcode5), is to switch off Autolayout and utilize the iOS6/7 Delta values for every view.
Basically:
Select every viewController's main view and uncheck "Use Autolayout"
Select every subView (UIButton, UILabel etc), go to the frame setting section
Increase their Y frame values by 20
but it seems you, #SudhakarTharigoppula, don't need to do this step.
...just do the next step
Enter a value of -20 for ΔY
This will start your app by leaving 20px in iOS7 but back in iOS6, the ΔY of -20px will compensate for the extra 20px you had given to every subView.
see: Status bar and navigation bar issue in IOS7

Use xcode5 develop ios6 programe, the view's origin Y [duplicate]

This question already has an answer here:
New iOS 7 statusBar leaves a range 20px in apps compiled in Xcode 5 [closed]
(1 answer)
Closed 9 years ago.
I have a app develop under ios6 and does not release for now, yesterday I'm upgrade my xcode to 5, and I'm try use it develop my old app, everything is ok, but some of my controller's base view's origin Y is 0 for now, it means these views are just below the status bar, and navigation bar over it. I don't want to add 44 to all of the controllers base view's frame origin y.
Does someone know about this, or do I needs to switch my xcode to 4
In my opinion you have two options:
1) Install the iOS6.1 SDK into Xcode5. The easiest way to do this is copy the ios6 SDK from Xcode 4 found in: Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/ and paste it in the same place inside Xcode5 app. (See more details here: Is it possible to install iOS 6 SDK on Xcode 5). After that you can use 'Base SDK: iOS6.1'.
2) Make all your navigation controllers opaque instead of translucent. For example in Interface Builder, uncheck the Translucent check box after selecting your navigation bar.

Resources