Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)scrollEventListToBottomAnimated:(BOOL)animated
- {
- CGFloat contentHeight = self.tableview.contentSize.height;
- CGFloat viewHeight = self.tableview.bounds.size.height;
- CGFloat scrollY = viewHeight > contentHeight ? 0 : contentHeight - viewHeight + 5.0;
- CGPoint scrollPos = CGPointMake(0, scrollY);
- if (animated) {
- [UIView animateWithDuration:0.2 animations:^{
- self.tableview.contentOffset = scrollPos;
- }];
- }
- else {
- self.tableview.contentOffset = scrollPos;
- }
- }
Add Comment
Please, Sign In to add comment