0

I have a single view in an xib (no view controller). I've added a small subview (UIView) at the bottom and set a constraint "Bottom space to superview" = 0. There are no other objects or constraints. I expected this view to "stick" to the bottom of the superview but when I view it on iPhone 6, iPhone 5, iPhone 4S, etc. the view doesn't stick but grows beyond the bottom of the screen.

I did the same thing using a UIButton and it works fine.

Thoughts?

rayg
  • 575
  • 1
  • 5
  • 7
  • if you are using autolayout you need to make separete .xib file for each iphone4, 5 and 6 – Noor Dec 05 '14 at 10:40
  • @NullData using Autolayout with sizeclasses enabled, you can use one XIB for every device. – Vinay Jain Dec 05 '14 at 10:53
  • @rayg are there any warnings for the XIB ? or are there any logs in console about NSLayoutConstraints ? – Vinay Jain Dec 05 '14 at 10:55
  • try to add constraint for height and width say 100:100 and check – Jageen Dec 05 '14 at 11:30
  • and also add image of xib file as i add image of story board for see constant you added. http://stackoverflow.com/questions/27291602/button-not-appearing-in-landscape-mode-in-ios-8/27292820#27292820 – Jageen Dec 05 '14 at 11:31

2 Answers2

1

It could occur, because one of your constraint is margin related. See the image.

enter image description here

Anton Gaenko
  • 8,929
  • 6
  • 44
  • 39
0

Everyone, thanks for all your comments! It ended up being that I needed to add additional width and height constraints. Not totally sure why these are needed but it seems to be working.

rayg
  • 575
  • 1
  • 5
  • 7