问题
I've a scenario where in I've to display four circles. These should be in center of screen. I tried to place x and top constraint but this doesn't works fine for iPhone 4 device.
What constraints should I set so that all four circles should appear in center for all iPhone device?
Further, there is UICollectionView in bottom. I tried to set the top, left, w and height but this didn't worked.
Any solution?
回答1:
1) Embed your 4 circle in UIView.
2) Set UIView constraint top, fixed width,fixed height and horizontal center
3) Now Select all 4 circle and set constraint like top, leading,trailing,bottom and equal width.
来源:https://stackoverflow.com/questions/38321280/constraints-to-be-set-for-x-position