0

I'm attempting to build a view (iPhone only, portrait view only) using adaptive layout. It should all be on a single screen (ideally no scrolling). I've managed to get it working (reasonably) for the iPhone 5 - 6+. However, my issue comes with the 4s.

enter image description here

I'd like, on the iPhone 4s to have the center image go away, which I thought I could use size classes, but it doesn't seem so for the various iPhones in portrait mode (only if I switch orientation).

Additionally, I'd like there to be more padding between all the elements on the 6+ while spacing remains the same on the 5 and 6.

shoesole
  • 105
  • 5

1 Answers1

0

No matter what sizes all iPhone in portrait mode is regular height compact width so size class won't help you here.

To change padding constraint

  1. make the ones you want to change IBOutlets

  2. and in viewDidLoad for example change the NSLayoutConstraint's constant value based on screen height.

For iPhone 4S you can

  1. hide the center imageView

  2. deactivateConstraints all it's constraints

  3. and activate new constraint between the view above imageView and below imageView if needed

dopcn
  • 4,218
  • 3
  • 23
  • 32