Autolayout: origin and size should change according to width and height factor

前端 未结 5 1858
-上瘾入骨i
-上瘾入骨i 2020-12-10 04:12

Here is a scenario what I needed.

I have put a UIButton on IB (size iPhone4 inch) whose initial frame on IB is x:100,y:100,w:100,h:100. I want the o

5条回答
  •  庸人自扰
    2020-12-10 04:39

    Try this solution

    1. Set views top alignment to superviews centerY and set the multiplier 84:240
    2. Set views left alignment to superviews center X and set the multiplier 100:160
    3. set proportional width with multiplier 100:320 and proportional height 100:568

    Image reflecting above propertyalign left to superview centerX

    Align top to superview centerY

    Hope this solves your problem

提交回复
热议问题