zoukankan      html  css  js  c++  java
  • UITableView设计思想 考察

    整体使用了build模式;单是组织结构混乱;不符合人类思维。

    UITableViewDataSource:描述了View的要素个数情况;并担负了builder功能。

    UITableViewDelegate:描述了要素的几何属性(组织者)并担负了builder功能。

    UITableView

    @property (nonatomic, strong, nullable) UIView *tableHeaderView;                           // accessory view for above row content. default is nil. not to be confused with section header

    @property (nonatomic, strong, nullable) UIView *tableFooterView;                           // accessory view below content. default is nil. not to be confused with section footer

    ==========================================

    this represents the display and behaviour of the cells.

    UITableViewDelegate

    // Variable height support

    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;

    - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section;

    - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section;

    // Section header & footer information. Views are preferred over title should you decide to provide both

    - (nullable UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section;   // custom view for header. will be adjusted to default or specified header height

    - (nullable UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section;   // custom view for footer. will be adjusted to default or specified footer height

    // Called after the user changes the selection.

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;

    - (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath NS_AVAILABLE_IOS(3_0);

    // this protocol represents the data model object. as such, it supplies no information about appearance (including the cells)

    UITableViewDataSource

    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView;

    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;

  • 相关阅读:
    MOSS 2010 修改管理员密码 欧阳锋
    MOSS2010 中“找不到位于xxxx的web应用程序”的解决办法 欧阳锋
    MSSQL 2008 无法修改表问题的解决 欧阳锋
    不是每个在你身上拉屎的都是你的敌人 欧阳锋
    笑一笑 欧阳锋
    隐藏MOSS2010 左边的导航 欧阳锋
    爱情与婚姻的区别 欧阳锋
    两年后,我们怎么办
    C#控件的闪烁问题解决方法总结
    Linux内核编译配置过程
  • 原文地址:https://www.cnblogs.com/feng9exe/p/7363993.html
Copyright © 2011-2022 走看看