由于button的坐标是相对于它的父视图来说的,所以你需要将button 转换成相对于self.view 的坐标系,然后再使用scrollRectToVisible方法来进行显示。伪代码如下:CGRect rect = [self.scrollview convertToRect:button.frame toView:self.view];
scrollView.scrollRectToVisible(button.frame, animated: true)
scrollView.scrollRectToVisible(button.frame, animated: true)
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货