Scale UIView and all its children

前端 未结 4 1552
独厮守ぢ
独厮守ぢ 2020-12-13 08:34

I have an UIView with around 50 UIButtons. All button positions were given in pixels, relative to the left upper corner of my main UIView.

All (background) images us

4条回答
  •  [愿得一人]
    2020-12-13 08:52

    I ended up using

    self.view.transform = CGAffineTransformScale(CGAffineTransformIdentity, 2, 2);
    

    It allowed me to keep the design created in the Interface Builder.

    Unfortunately the sharpness of the image suffers in that case, but this is a small price to pay compared to scripting the whole design programmatically.

提交回复
热议问题