Reputation: 95
I am trying to create a grid type layout using Interface Builder/Storyboards. I am using a UIImageView as a background picture and placing UIButtons over the areas of the image that I want to be interactive. No matter what constraints I try I cannot seem to get the buttons to their proper spots. I have attached screen shots from Xcode 6, and well as provided a link to the project on GitHub. Thank you so much to anyone that can provide some insight.
Edit
After taking Matt's advice from the comments I created a layout using the images as the actual buttons. It works really well, but I can seem to get the buttons to constrain to each other properly. I have attached a few images of what I'm getting now. If anyone has any idea what's going on that would be great! Also the GitHub Repository has been updated as well.
As a note, I am intentionally leaving the black bar at the bottom.
View that I see on iPhone 4/4s
Upvotes: 2
Views: 1687
Reputation: 48514
As an example, and assuming you do not want your buttons to resize:
Repeat vertically.
Upvotes: 1
Reputation: 9354
Please look into shared XIB.
You can achieve it via proportional to superview width or height constraint, +- constant for padding.
https://dl.dropboxusercontent.com/u/48223929/AutolayoutExampleView.xib
Upvotes: 1