// // CCUITableView.m // CCFC // // Created by xichen on 11-12-28. // Copyright 2011 ccteam. All rights reserved. // #import "CCUITableView.h" #import "CCUIView.h" @implementation UITableView(cc) - (void)scrollToBottom:(BOOL)animated { NSUInteger lastSection = [self numberOfSections] - 1; NSIndexPath *indexPath = [NSIndexPath indexPathForRow:[self numberOfRowsInSection:lastSection] inSection:lastSection]; [self scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:animated]; } // get the vertical scroll indicator - (UIView *)getVerticalScrollIndicator { id verticalIndicatorImgView = nil; object_getInstanceVariable(self, "_verticalScrollIndicator", (void **)&verticalIndicatorImgView); return (UIView *)verticalIndicatorImgView; } // hide the vertical scroll indicator - (BOOL)hideVerticalScrollIndicator { UIView *indicatorView = [self getVerticalScrollIndicator]; indicatorView.hidden = YES; return indicatorView != nil; } @end可能有更新:
googlecode链接地址: http://code.google.com/p/iphone-common-codes-ccteam/source/browse/trunk/CCFC/files/CCUITableView.m
googlecode链接地址: http://code.google.com/p/iphone-common-codes-ccteam/source/browse/trunk/CCFC/files/CCUITableView.m
github地址: https://github.com/cxsjabc/iphone-common-codes-ccteam/tree/master/CCFC/files/CCUITableView.m
本文深入解析了CCUITableView类中的滚动到底部方法scrollToBottom:animated:和获取垂直滚动指示器方法getVerticalScrollIndicator,以及隐藏垂直滚动指示器方法hideVerticalScrollIndicator。

被折叠的 条评论
为什么被折叠?



