check this image and made your constraints like below…
RESULT:- preview in different sizes
With Stackview (For iOS 9.0 and above)
NOTE: If you have to make app for iOS 9 and later then
UIStackView
is another option for you
More Related Contents:
- How to add constraints programmatically using Swift
- When can I activate/deactivate layout constraints?
- Moving views with constraints
- Programmatically Add CenterX/CenterY Constraints
- When should translatesAutoresizingMaskIntoConstraints be set to true?
- UIScrollView Scrollable Content Size Ambiguity
- reloadData() of UITableView with Dynamic cell heights causes jumpy scrolling
- How to adjust height of UICollectionView to be the height of the content size of the UICollectionView?
- iOS: How does one animate to new autolayout constraint (height)
- Auto layout constraints issue on iOS7 in UITableViewCell
- With Auto Layout, how do I make a UIImageView’s size dynamic depending on the image?
- setNeedsLayout vs. setNeedsUpdateConstraints and layoutIfNeeded vs updateConstraintsIfNeeded
- Multiple UILabels inside a self sizing UITableViewCell
- Setting tableHeaderView height dynamically
- Using ScrollView Programmatically in Swift 3
- UIStackView Distribution Fill Equally
- UITableView within UIScrollView using autolayout
- Autolayout: Add constraint to superview and not Top Layout Guide?
- UICollectionView header dynamic height using Auto Layout
- Centering subview’s X in autolayout throws “not prepared for the constraint”
- How to keep a round imageView round using auto layout?
- UITextView that expands to text using auto layout
- Loading a ViewController inside a Container View
- Set UITableView’s height to the height of its content with Auto Layout
- Resize the screen when keyboard appears
- View at the bottom in a UIScrollView, with AutoLayout
- AutoLayout views make app crash on popViewController
- Using autolayout in a tableHeaderView
- Proportional height (or width) in SwiftUI
- UITableView auto resizing row constraint breaking mysteriously on iPhone 6Plus