. UITableView

参考:
https://developer.apple.com/library/ios/#documentation/UIKit/Reference/UITableView_Class/Reference/Reference.html ) 初始化 UITableView对象
– initWithFrame:style: // 代码生成方式,如果你在nib里加的tableview不需要使用这个方法
)配置TableView
– dequeueReusableCellWithIdentifier: // 必须要实现的方法,与TableView同生同死
style property // 有两种 UITableViewStylePlain, UITableViewStyleGrouped,经常用
– numberOfRowsInSection: //一个section有多少行,经常用
– numberOfSections //一个TableView有多少个section,经常用
rowHeight property // 行高,和tableView:heightForRowAtIndexPath:有性能上的区别
separatorStyle property // cell之间的分割线?待确认
separatorColor property // 同上
backgroundView property // tableview的背景view, 这个背景view在所有cell, header views, footer views之后
tableHeaderView property // tableview上方的一个headerView, 和delete里的section header不是一个概念
tableFooterView property // tableview下方的一个footerview
sectionHeaderHeight property // section Header的高度,
sectionFooterHeight property // sectjion Footer的高度
sectionIndexMinimumDisplayRowCount property // 功能待确认? 参考例子: TheElements
) 访问Cells和Sections
– cellForRowAtIndexPath: //根据IndexPath返回cell
– indexPathForCell: //根据cell返回它的indexPath,和上面的方法互补
– indexPathForRowAtPoint://根据一个几何点返回indexPath,如果超过边界返回nil
– indexPathsForRowsInRect: //根据一个几何的矩形返回矩形所覆盖的行,返回是一个indexPath数组
– visibleCells // 不清楚怎么用,待确认
– indexPathsForVisibleRows //同上
) 滚动TableView
– scrollToRowAtIndexPath:atScrollPosition:animated: // 滚动到指定位置
– scrollToNearestSelectedRowAtScrollPosition:animated: // 同上
) 管理sections
– indexPathForSelectedRow //返回选定行的indexPath,单行
– indexPathsForSelectedRows //返回选定行的indexPath数组,多行
– selectRowAtIndexPath:animated:scrollPosition: //根据indexPath选择一行
– deselectRowAtIndexPath:animated: //反选一行,有何用?
allowsSelection property //是否允许用户选取一行
allowsMultipleSelection property // 是否选取多行,缺省为NO. 可以试试YES后的效果,哈哈
allowsSelectionDuringEditing property // 编辑模式时是否可选取一行
allowsMultipleSelectionDuringEditing property // 编辑模式时可否选取多行
) 插入、删除、移动行和sections
– beginUpdates // 和endUpdates一起用,让插入、删除、选择操作同时动画,没用过
– endUpdates //
– insertRowsAtIndexPaths:withRowAnimation: //根据indexPath数组插入行
– deleteRowsAtIndexPaths:withRowAnimation: //根据indexPath数组删除行
– moveRowAtIndexPath:toIndexPath: //移动一行到另一行
– insertSections:withRowAnimation: //插入sections
– deleteSections:withRowAnimation: //删除sections
– moveSection:toSection: //移动section
) 管理和编辑cell
editing property // YES进入编辑模式,tableview cell会出现插入、删除、重排序的控件
– setEditing:animated: //设置进入退出编辑模式
) 重新加载TableView
– reloadData // 重建整个表,包括cells、header、footer,indexs
– reloadRowsAtIndexPaths:withRowAnimation: // 改进,不用reload整个表
– reloadSections:withRowAnimation: // 同上
– reloadSectionIndexTitles // 同上
) 访问TableView的画图区
– rectForSection: // 返回指定section的矩形
– rectForRowAtIndexPath: //返回indexPath指定行的矩形
– rectForFooterInSection: // 返回section的footer矩形
– rectForHeaderInSection: // 返回section的header矩形
) Registering Nib Objects for Cell Reuse
– registerNib:forCellReuseIdentifier: //
) 管理委托和数据源 (重要)
dataSource property // 通常会这么用: myTableView.delegate = self; self 为viewController
delegate property // 通常会这么用: myTableView.dataSource = self; self 为viewController

二、UITableView和它的亲戚们的更多相关文章

  1. UITableView使用指南

    本文转载至 http://blog.csdn.net/yu0089/article/details/8227402 一.概述 UITableView是iOS开发比不可少也是最重要的一个控件类.可以说任 ...

  2. IOS开发之表视图(UITableView)

    IOS开发之表视图(UITableView)的基本介绍(一) (一):UITableView的基本概念 1.在IOS开发中,表视图的应用十分广泛和普及.因此掌握表视图的用法显得非常重要.一般情况下对于 ...

  3. iOS-UITableView的优化(纯手打原创)

    TableView的优化 一:什么是TableView的优化以及为什么要优化 1)CPU(中央处理器)和GPU(图形处理器)   CPU主要从事逻辑计算的一些工作 GPU主要从事图形处理方面的工作 2 ...

  4. ios基础篇(十四)——UITableView(二)属性及基本用法

    上一篇说了UITableView的重用机制,让我们对UITableView有了简单了解,下面说说UITableView的属性及常见方法. 一.属性 1.frame:设置控件的尺寸和大小 2.backg ...

  5. iOS开发UI篇—使用UItableview完成一个简单的QQ好友列表(二)

    一.实现效果             二.实现代码 1.数据模型部分 YYQQGroupModel.h文件 // // YYQQGroupModel.h // 02-QQ好友列表(基本数据的加载) / ...

  6. iOS开发——开发必备OC篇&UITableView设置界面完整封装(二)

    UITableView设置界面完整封装(二) 简单MVC实现UITableView设置界面之Cell右边类型设置 首先来看看第一种方法证明使用,结合两种方法之后根据个人的爱好去选择就可以了, 一:使用 ...

  7. UIPasteboard粘贴板:UITableView复制粘贴功能(二)

    这篇咱写写一写在UITableView上实用剪贴板的两种方法: 一:在自定义cell里面使用 其实,在cell的使用跟在label里面的用法基本一样 1.放方法: - (BOOL)canBecomeF ...

  8. UITableView(二)

    #import "ViewController.h" @interface ViewController () @end @implementation ViewControlle ...

  9. ios基础篇(二十八)—— UITableView的上拉加载

    本文主要展示一个demo实现UITableView的上拉加载数据: 先看看效果图: 接着上拉,加载更多数据: 主要实现的效果是在我们上拉结束拖拽之后,开始加载数据,数据加载的过程中有滚动轮提示用户正在 ...

随机推荐

  1. python的行与缩进

    #coding=utf-8#逻辑行与物理行#以下是3个物理行print "abc"print "789"print "777" #以下是1个 ...

  2. excel导入mssql数据库,支持excel2003--2010文件格式

    rt,简单的excel导入mssql.未做性能及海量数据优化,一般单表5000左右条数据导入适用. 源码非原创,来源于之前搜集整理,原作者无从考究,如有版权问题请留言注明. 看代码.前台页面是一个Fi ...

  3. JS 实现 Tab标签切换功能

    Tab标签切换 效果图: HTML部分: <div class="wrap">     <ul id="tag">       < ...

  4. 如何给report自定义page number

    问题描述: report在设置分页后会自动分页,但是有默认的page number,现在的问题是有时default page number不能满足我们的需求,此时就需要自定义page number. ...

  5. 第一次启动MySQL时报错

    [root@localhost~]#/usr/local/webserver/mysql/bin/mysql_install_db --basedir=/usr/local/webserver/mys ...

  6. 策略模式Strategy(对象行为型)

    原文地址:http://blog.csdn.net/hguisu/article/details/75582491.策略模式:定义一系列的算法,把每一个算法封装起来, 并且使它们可相互替换.本模式使得 ...

  7. iOS实现OAuth2.0中刷新access token并重新请求数据操作

    一.简要概述 OAuth2.0是OAuth协议的下一版本,时常用于移动客户端的开发,是一种比较安全的机制.在OAuth 2.0中,server将发行一个短有效期的access token和长生命期的r ...

  8. C++拾遗(十一)类继承

    首先,这里提到的继承都是公用继承. 派生类 1.派生类需要添加自己的构造函数. 2.派生类创建之前会首先创建基类对象,即调用基类构造函数.在派生类构造函数后通过初始化列表将参数传递给基类构造函数. 3 ...

  9. centos 安装php

    1.yum安装 yum install php php-fpm php-common php-gd php-mcrypt php-pear php-pecl-memcache php-mhash ph ...

  10. WDCP安装memcached

    memcached安装 我们打开Web控制面板的时候其实memcached是没有安装的,所以我们要手动安装这个组件. 首先是要下载安装源代码并执行. 1 2 wget -c http://down.w ...