UIView not resizing when rotated with a CGAffineTransform under iOS8

前端 未结 3 1710
粉色の甜心
粉色の甜心 2020-12-29 16:45

I have a UIViewController that only rotates some of it subviews when the device is rotated. This works fine under iOS7 but breaks under iOS8. It appears that the UIView\'s b

3条回答
  •  心在旅途
    2020-12-29 17:02

    This is more of a work around than a fix so it may not help everybody in similar situations. My problem was that the outer "pinned" view was being resized again after the transform was applied.

    My solution was to change the constraints on the pinned view to be center vertically, center horizontally, and width and height equal a constant.

    Then, in viewDidLoad, I set the height and width of the pinned view's frame to be the height of the main screen. This makes the view square so I don't care if it gets an extra rotate.

提交回复
热议问题