可在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];
//启用删除
- (void)tableView:(UITableView*)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath
{
CustomAlarmCell *cell = (CustomAlarmCell*)[tableView cellForRowAtIndexPath:indexPath];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDelay:.1f];
[UIView commitAnimations];
}
- (void)tableView:(UITableView*)tableView didEndEditingRowAtIndexPath:(NSIndexPath *)indexPath
{
CustomAlarmCell *cell = (CustomAlarmCell*)[tableView cellForRowAtIndexPath:indexPath];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDelay:.1f];
[UIView commitAnimations];
}
在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];
//启用删除
- (void)tableView:(UITableView*)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath
{
CustomAlarmCell *cell = (CustomAlarmCell*)[tableView cellForRowAtIndexPath:indexPath];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDelay:.1f];
[UIView commitAnimations];
}
- (void)tableView:(UITableView*)tableView didEndEditingRowAtIndexPath:(NSIndexPath *)indexPath
{
CustomAlarmCell *cell = (CustomAlarmCell*)[tableView cellForRowAtIndexPath:indexPath];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDelay:.1f];
[UIView commitAnimations];
}