记录在开发过程中的一些小技巧的使用
TableView
取消 table view 的 section 悬停
有时候,通过使用 sectionView 实现tableView的间隔效果,但是不想让这个间隔悬停。1
2
3
4
5
6
7
8
9- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
CGFloat sectionHeaderHeight = 12;
if (scrollView.contentOffset.y<=sectionHeaderHeight&&scrollView.contentOffset.y>=0) {
scrollView.contentInset = UIEdgeInsetsMake(-scrollView.contentOffset.y, 0, 0, 0);
} else if (scrollView.contentOffset.y>=sectionHeaderHeight) {
scrollView.contentInset = UIEdgeInsetsMake(-sectionHeaderHeight, 0, 0, 0);
}
}
tableView 中有输入框,键盘隐藏 - UITableViewController 的效果
通过实现UITableViewController中控制键盘的效果,又不使用UITableViewController
1 | - (UITableView *)tableView { |