首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

tableview设立上下滚动高度

2013-08-10 
tableview设置上下滚动高度可在viewDidAppear中实现加入 [tablvew setContentOffset:CGPointMake(0,480) a

tableview设置上下滚动高度
可在viewDidAppear中实现加入 [tablvew setContentOffset:CGPointMake(0,480) animated:YES]; 
在tableView内添加一个searchbar,一起滚动;开始时隐藏headerView(即让tableView向上滚动headerView的高度:默认44) 
UISearchBar *mySearchBar = [[UISearchBar alloc] init]; 
[mySearchBar sizeToFit]; 
 
tableView.tableHeaderView = mySearchBar; 
//UITableView开始滚动到的位置(这样一开始headerView是不显示的) 
[tableView setContentOffset:CGPointMake(0.0, 44.0) animated:NO]; 

热点排行