我在scrollview中有20个imageview,我在SubScrollView中的下一个ViewController中显示所选图像......
我想缩放特定的imageView,我不知道得到那个imageview标签,这是我的代码
func viewForZoomingInScrollView(scrollView: UIScrollView) -> UIView?
{
var i : Int = 0
var imgView = UIImageView()
for img in scrollView.subviews
{
imgView = view.viewWithTag(Tags.Tag_imgView.rawValue + i)
imgView = img as UIImageView
break
}
return imgView
}
答案 0 :(得分:0)
func viewForZoomingInScrollView(scrollView: UIScrollView) -> UIView?
{
var imgView : UIImageView? = view.viewWithTag(Tags.Tag_imgView.rawValue) as? UIImageView
for img in scrollView.subviews
{
imgView = img as? UIImageView
break
}
return imgView
}