• WWDC笔记:2011 Session 125 UITableView Changes, Tips and Tricks


    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
  • 相关阅读:
    uiatuomator如何调试
    uiatuomator提示shortMsg=java.lang.RuntimeException
    uiatuomator命令启动apk,与查找多个相同控件
    uiautomator日志文件转换为xml格式文件
    uiautomator做自动化的过程
    uiautomator的坑和AAPT命令方式启动一个应用程序
    ADB无线连接
    用fiddler工具做接口测试
    简单的monkey使用
    疯狂学习java web2(css)
  • 原文地址:https://www.cnblogs.com/wxy325/p/3190249.html
Copyright © 2020-2023  润新知