zoukankan      html  css  js  c++  java
  • contentOffset、contentSize和contentInset

    1、UIScrollView
    @property(nonatomic)CGPoint contentOffset;
    这个属性用来表示UIScrollView滚动的位置

    @property(nonatomic)CGSize contentSize;
    这个属性用来表示UIScrollView内容的尺寸,滚动范围(能滚多远)

    @property(nonatomic)UIEdgeInsets contentInset;
    这个属性能够在UIScrollView的4周增加额外的滚动区域

    2、UITableView
    UITableView是UIScrollView的子类,tabelview的contentsize是由它的下列方法共同实现的

    - (NSInteger)numberOfSections;
    - (NSInteger)numberOfRowsInSection:(NSInteger)section;
    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;
    - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section;
    - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section;

    它会自动计算所有的高度和来做为它的contentsize的height.

    例如你在delegate方法

    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 
    {
        return 100;
    }

    那么你的tabelview的contentsize就是(320, 4400)

  • 相关阅读:
    LINUX 系统性能检测工具vmstat
    ebs 初始化登陆
    oracle 以SYSDBA远程连接数据库
    ORACLE hint
    ORACLE CACHE BUFFER CHAINS原理
    oracle 当月日历的sql
    oracle to_char处理日期
    EBS 抓trace 文件
    oracle 执行计划的获取方法
    linux ln用法
  • 原文地址:https://www.cnblogs.com/liuzhi20101016/p/5203909.html
Copyright © 2011-2022 走看看