IOS tips and tips
- The following problems are all encountered by myself in the project. There are certainly many ways to solve the problem. What I list is not necessarily the best solution. If you have any questions, please let us know, add, and communicate with you.
// Sometimes the list implemented by UITableView uses section, but does not want it to stick to the top but disappears or appears as a scroll (void) scrollViewDidScroll :( UIScrollView *) scrollView {if (scrollView ==_tableview) {CGFloat sectionHeaderHeight = 36; 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 );}}}
Text/Simba_LX (simplified author)
Link: http://www.jianshu.com/p/970469cb0428
Copyright belongs to the author. For reprinted content, contact the author for authorization and mark "author of simplified book ".