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)
contentOffset、contentSize和contentInset的更多相关文章
- contentSize、contentInset和contentOffset的区分
一. frame.bounds和center的区分 frame:由左边原点和矩形面积组成,其中原点代表其在父视图中的起点位置. bounds:就是原点始终为(0,0)的frame. center:本 ...
- contentSize、contentInset和contentOffset区别
contentSize.contentInset和contentOffset区别 分类: iphone开发2011-12-05 21:49 23495人阅读 评论(4) 收藏 举报 uiviewios ...
- contentSize、contentInset和contentOffset
contentSize.contentInset和contentOffset 是 scrollView三个基本的属性. contentSize: The size of the content vie ...
- contentSize、contentInset和contentOffset 是 scrollView三个基本的属性区别和使用
contentSize.contentInset和contentOffset 是 scrollView三个基本的属性. contentSize: 其实就是scrollview可以滚动的区域,比如fra ...
- UIScrollView控件及其三个常用属性:contentSize、contentInset和contentOffset
如果您对UIScrollView控件感到难以理解,下面是本人自己对UIScrollView控件的理解方式,按照我的思路,理解UIScrollView控件非常容易! 我对UIScrollView的构成理 ...
- iOS开发系列--无限循环的图片浏览器
--UIKit之UIScrollView 概述 UIKit框架中有大量的控件供开发者使用,在iOS开发中不仅可以直接使用这些控件还可以在这些控件的基础上进行扩展打造自己的控件.在这个系列中如果每个控件 ...
- IOS开发基础知识碎片-导航
1:IOS开发基础知识--碎片1 a:NSString与NSInteger的互换 b:Objective-c中集合里面不能存放基础类型,比如int string float等,只能把它们转化成对象才可 ...
- 学习笔记之-------UIScrollView 基本用法 代理使用
//contentSize.contentInset和contentOffset 是 scrollView三个基本的属性. // 滚动 self.ScrollView.contentSize =sel ...
- IOS开发基础知识--碎片17
1:contentSize.contentInset和contentOffset区别 contentSize 是scrollview中的一个属性,它代表scrollview中的可显示区域,假如有一个s ...
随机推荐
- css网页布局模板
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...
- kafka cmd首个单机例子配置
下载地址:http://kafka.apache.org/downloads http://mirror.bit.edu.cn/apache/kafka/2.3.0/kafka_2.12- ...
- Unitest自动化测试基于HTMLTestRunner报告案例
报告效果如下: HTMLTestRunner脚本代码如下: #coding=utf-8 # URL: http://tungwaiyip.info/software/HTMLTestRunner.ht ...
- python的exe反编译
目录 python的exe反编译 方法一.使用archive_viewer.py提取pyc 方法二.使用pyinstxtractor.py提取pyc python的exe反编译 驱动人生样本为pyth ...
- jmeter测试并发
由于生产出现个并发问题,本地没法重现.后来网上有人说使用jmeter可以测试并发,也有人说postman可以测试.但本着试试新鲜的东西,就用jmeter. 到apache上面下载. 下载加压,然后运行 ...
- Kafka学习(一)
官网 kafka.apache.org 集群部署 消息中间键 --> 分布式流式平台 Kafka Streaming Flume: 1个进程包含三个角色 source channle sink ...
- oracle12.2RAC之OGG安装配置(二)
本机到本机的配置: 源端 10.1.83.144:1521/SIBP_GSDY HNSIB_GSDY目标端 10.1.83.144:1521/SIBP_GS HN ...
- 如何在文本编辑器中实现搜索功能? 字符串比较算法 BF算法 RK算法
1.暴力比较 BF算法 2.比较字串hash值 RK算法 //字符串匹配 public class StringCmp { //约定:A主串长 n ,B模式串 长m.要求:在A串中找到B串匹配的下标 ...
- springmvc的入门
1. 什么是springMVC? Spring Web MVC是一种基于Java的实现了MVC设计模式的.请求驱动类型的.轻量级Web框架. 2. SpringMVC处理请求的流程 2.1 首先用户发 ...
- shell 下
一句话来概括shell shell是一个基于Linux内核和应用程序之间的一个解释器 Shell解释器 /bin/sh /bin/bash 目前多用的是bash /sbin/ ...