iOS aspect ratio constraint breaks on iOS7, works on iOS8

前端 未结 6 1749
春和景丽
春和景丽 2021-02-04 18:37

In my app, I have setup a UIView\'s constraints in a way where its height gets calculated from its width using the aspect ratio constraint. It works perfectly on iOS8 with every

6条回答
  •  野性不改
    2021-02-04 19:31

    I resolved it You don't set ratio itself. You should set equal with its container But better you should set height constraint follow iPhone 6. You must outlet constrain in your class. In viewDidLoad you must multiplier with DISPLAY_SCALE

     DISPLAY_SCALE = UIScreen.mainScreen().bounds.width / 375
    

    // 375 is width of iPhone 6.

    Why do you must do that? I think iOS7 delay when calculator our constraint. And it wrong when show

提交回复
热议问题