我正试图将图像置于屏幕中心。我认为它会像我的代码示例一样简单,但它似乎只是在底部添加空间。任何想法如何让它居中?
if (imageView.frame.size.height > imageView.frame.size.width){
scrollView.minimumZoomScale = scrollView.frame.size.height / imageView.frame.size.height
margin = ((scrollView.frame.size.height - imageView.frame.size.height) / 2.0)
scrollView.contentInset = UIEdgeInsetsMake(margin, 0, margin, 0)
}