首页 > 代码库 > uiscrollview 滚动

uiscrollview 滚动

获取当前滚动到的位置

- (void)scrollViewDidScroll:(UIScrollView *)scrollView{       CGRect bounds = self.scrollview.bounds;    CGPoint offset = self.scrollview.contentOffset; 
UIEdgeInsets inset = self.scrollview.contentInset;
CGFloat currentOffset = offset.x + bounds.size.width - inset.bottom;
NSLog(@"%2f",currentOffset);
}

 设置offset滚动到指定位置

uiscrollview 滚动