首页 > 其他 > 详细

在tabelview上添加悬浮按钮,跳转顶部 或指定地方

时间:2014-02-28 16:46:26      阅读:468      评论:0      收藏:0      [点我收藏+]

[self.chatTableView scrollToRowAtIndexPath:

[NSIndexPath indexPathForRow:[self.chatArray count]-1 inSection:0]

atScrollPosition: UITableViewScrollPositionBottom

animated:NO];



关于UITableView如何跳转到最后一行或者任意指定行。

其实现如下:

NSUInteger sectionCount = [self.tableView numberOfSections];

if (sectionCount) {

NSUInteger rowCount = [self.tableView numberOfRowsInSection:0];

if (rowCount) {

NSUInteger ii[2] = {0, rowCount - 1};

NSIndexPath* indexPath = [NSIndexPath indexPathWithIndexes:ii length:2];

[self.tableView scrollToRowAtIndexPath:indexPath

atScrollPosition:UITableViewScrollPositionBottom animated:YES];

}

}


本文出自 “yuanyuhang” 博客,请务必保留此出处http://darkeve.blog.51cto.com/7680170/1364618

在tabelview上添加悬浮按钮,跳转顶部 或指定地方,布布扣,bubuko.com

在tabelview上添加悬浮按钮,跳转顶部 或指定地方

原文:http://darkeve.blog.51cto.com/7680170/1364618

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!