WWDC笔记:2011 Session 125 UITableView Changes, Tips and Tricks
2024-08-30 17:41:03
What’s New
Automatic Dimensions
- (CGFloat)tableView:(UITableView *)tableView
heightForHeaderInSection:(NSInteger)section
CGFloat UITableViewAutomaticDimension
Automatic Animation Style
UITableViewRowAnimationAutomatic
New Update Methods
- (void)moveSection:(NSInteger)section
toSection:(NSInteger)newSection
- (void)insertSections:(NSIndexSet *)sections
withRowAnimation:(UITableViewRowAnimation)animation
- (void)deleteSections:(NSIndexSet *)sections
withRowAnimation:(UITableViewRowAnimation)animation
- (void)reloadSections:(NSIndexSet *)sections
withRowAnimation:(UITableViewRowAnimation)animation
Demo
[self.tableView beginUpdates]; //更新cell位置section位置等等 [self.tableView endUpdates];
Menu Suppor
- (BOOL)tableView:(UITableView *)tableView
shouldShowMenuForRowAtIndexPath:(NSIndexPath *)indexPath
- (BOOL)tableView:(UITableView *)tableView
canPerformAction:(SEL)action
forRowAtIndexPath:(NSIndexPath *)indexPath
withSender:(id)sender
- (void)tableView:(UITableView *)tableView
performAction:(SEL)action
forRowAtIndexPath:(NSIndexPath *)indexPath
withSender:(id)sender
Multiple Selection
Table View Properties
BOOL allowsMultipleSelection
BOOL allowsMultipleSelectionDuringEditing
BOOL allowsSelection
BOOL allowsSelectionDuringEditing
Table View Method
- (NSArray *)indexPathsForSelectedRows
- (NSIndexPath *)indexPathForSelectedRow
Table View Cell Property
UIView *multipleSelectionBackgroundView
UIView *selectedBackgroundView
Automatic Cell Loading
- (void)registerNib:(UINib *)nib
forCellReuseIdentifier:(NSString *)identifier
Nib Constraints
- Nib must contain a single table view cell
- Cell’s reuse identifier must match the one specified above (or be nil)
Tips and Tricks
Action Row
Floating View
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
Dynamic Background View
两倍background大小,animation option: UIViewAnimationOptionRepeat | UIViewAnimationOptionCurveLinear
Related Session
- Simplifying Touch Event Handling with Gesture Recognizers
- Advanced Gesture Recognition
最新文章
- NOIP2015 心得
- 《Python CookBook2》 第一章 文本 - 检查字符串中是否包含某字符集合中的字符 &;&; 简化字符串的translate方法的使用
- 理解php Hash函数,增强密码安全
- Python核心编程2第五章课后练习
- HBase shell 操作命令记录
- CSS3 @keyframes 规则
- 【USACO09OCT】热浪Heat Wave
- javascript中apply、call和bind的区别及方法详解
- 深入理解javascript原型和闭包(转)
- opencv3.1+cmake3.7.2+cuda9.1+vs2015+opencv-contrib+win10x64
- Jenkins+Git+Maven构建并部署war包到tomcat
- C#进阶系列——AOP
- 查看windows上次开机时间
- 我推荐阅读的微信公众号-IT类
- Android使用binder访问service的方式(一)
- git实践:对比svn
- NEFU 118 - n!后面有多少个0 &; NEFU 119 - 组合素数 - [n!的素因子分解]
- 使用Bootstrap 3开发响应式网站实践01,前期准备、导航区域等
- Note.js的stream用法一例
- ASP.NET MVC ajax处理 AjaxResult