I have created the new iOS project in xCode 5 with deployment target 6.0 and Apply Pin constraint [Bottom space to superview] to make AutoLayout applicable for iOS 7 as well iOS 6.0 with different devices but
When I choose option "View as : " : iOS 7.0 & later Button looks like following
then When I change option "View as : " : iOS 6.0 & earlier the button looks like following
How Do I manage constrait such a way that make applicable with iOS 6.0 & iOS 7.0 both ?
Thanks in advance !!
Most constraints define a relationship between two items in our user interface. These items can represent either views or layout guides. Constraints can also define the relationship between two different attributes of a single item, for example, setting an aspect ratio between an item's height and width.
Auto Layout is the preferred technology to define layouts for user interfaces on iOS and macOS. Its goal: To make it easy for you to create user interfaces that adapt automatically to different screen sizes and orientations.
Open the Align menu with the yellow button selected and check Horizontally in Container, then click Add 1 Constraint. Now, select both buttons at the same time using the Shift key and, in the Align menu, check Leading Edges. Again, actually install the constraint by clicking Add 1 Constraint.
Basically if the layout margins are 8,8,8,8 (the default), a constraint with 0 leading space to container margin will have an x position of 8. Note that this is only available on iOS8 or later.
I had a similar issue in my story board, I searched a lot with no hope and ended up removing all constrains by:
Editor -> Resolve Auto-Layout Issues -> Clear all constraints in view controller
Then reordering again, this solved most of my issues.
First from Apple Transition Guide:
If business reasons require you to continue supporting iOS 6 or earlier, you need to choose the most practical way to update the app for iOS 7. The techniques you choose can differ, but the overall advice remains the same: First, focus on redesigning the app for iOS 7. Then, bring the changes to the iOS 6 version as appropriate.
This means that you could face some issues in prior iOS versions, especially in layout and you need to re-layout your controls under iOS7
then test them under iOS6
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With