动画移动scrollview内容

#pragma mark - 按钮的点击

- (IBAction)top {
    /*
    [UIView animateWithDuration:2.0 animations:^{
//        CGPoint offset = self.scrollView.contentOffset;
//        offset.y = 0;
//        self.scrollView.contentOffset = offset;
        self.scrollView.contentOffset = CGPointMake(self.scrollView.contentOffset.x, 0);
    }];
     */
    
    [self.scrollView setContentOffset:CGPointMake(self.scrollView.contentOffset.x, 0) animated:YES];
    
}

 

posted @ 2017-03-19 20:50  iFat  阅读(169)  评论(0编辑  收藏  举报