UITableViewController

目录

  • 概述
  • UITableView
  • UITableViewCell
  • 与UITableViewController相关的代理

UITableViewDataSource

UITableViewDelegate

  • UITableViewController的常用操作

选中单元格

编辑、移动、添加、删除单元格

索引的创建

根据关键字排序

下拉或上拉刷新表格视图

搜索框和表格视图的交互

概述

对UITableViewController的理解

UITableView

视图控制器

UITableViewController或其子类

非UITableViewController或其子类,需手动设置UITableView的dataSource和delegate这两个代理

UITableViewCell

样式

系统自带UITableViewCell样式

自定义UITableViewCell样式

与UITableViewController相关的代理

UITableViewDataSource

UITableViewDelegate

UITableViewController的常用操作

选中单元格

相关的代理方法(4个):- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

编辑、移动、添加、删除单元格

编辑

- (void)setEditing:(BOOL)editing animated:(BOOL)animate

删除

- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath

添加

+ (NSIndexPath *)indexPathForRow:(NSInteger)row inSection:(NSInteger)section

- (void)insertRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation

移动

- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath

- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath

索引的创建

UITableViewController的更多相关文章

  1. iOS UITableView 与 UITableViewController

    很多应用都会在界面中使用某种列表控件:用户可以选中.删除或重新排列列表中的项目.这些控件其实都是UITableView 对象,可以用来显示一组对象,例如,用户地址薄中的一组人名.项目地址. UITab ...

  2. UITableViewController和XML解析还有地图的简单结合

    然后我的代码就按照上面的这个顺序输出. #import <Foundation/Foundation.h> #import <MapKit/MapKit.h> @interfa ...

  3. UITableViewController和延时执行、自定义控件

    1.在UITableViewController中,self.view就是self.tableView, 两个对象的指针地址是一样的 2.自定义类继承UITableViewCell, 重写父类方法 / ...

  4. iOS--通讯录(UITableViewController)

    本文主要实现通讯录的部分功能(分组名.索引.分组的组名)等等功能: 废话不多说了,先上效果图: 在工程中需要导入一个plist文件,文件图如图: 工程目录文件如图: 工程程序如图所示: RootTab ...

  5. iOS--(UITableViewCell)、(UITableViewController)微信个人主页

    本文主要实现了微信的个人主页的设置: 目录文件如下: 实现代码如下: RootTableViewController.h #import <UIKit/UIKit.h> @interfac ...

  6. iOS UITableView , UITableViewController ,UITableViewCell实现全国各省市遍历,选择相应的地区

    我们先看一下效果                   代码如下 首先是第一个页面 rootTableViewController.h #import <UIKit/UIKit.h> #im ...

  7. iOS7上在xib中使用UITableViewController设置背景色bug

    今天用xcode5.1设置xib中,用静态的方式设置UITableViewController中的tableview,把tableview中的backgroundColor改变后,xib上有效果,但是 ...

  8. UITableView & UITableViewController

    内容概要: 本文先讲解了UITableView概述,然后主要从应用方面讲解了UITableViewController(包括add.delete.move单元cell的操作,以及UITableView ...

  9. iOS - UITableViewController

    前言 NS_CLASS_AVAILABLE_IOS(2_0) @interface UITableView : UIScrollView <NSCoding> @available(iOS ...

  10. UITableViewController 滚动引起的cocos2d动画暂停问题的解决

    UITableViewController 滚动引起的cocos2d动画暂停问题的解决 之前在使用UITableViewController进行滚动时,cocos2d的动画会暂停,直至滚动完毕才会继续 ...

随机推荐

  1. Using NuGet without committing packages to source control(在没有把包包提交到代码管理器的情况下使用NuGet进行还原 )

    外国老用的语言就是谨慎,连场景都限定好了,其实我们经常下载到有用NuGet引用包包然而却没法编译的情况,上谷歌百度搜又没法使用准确的关键字,最多能用到的就是nuget跟packages.config, ...

  2. dispatch_once单例初始化

    static GHCache *instance = nil; /** *  单例,静态初始化方法 * *  @return 返回一个单例 */ + (GHCache*)shareCache{ sta ...

  3. BITED程序员语言学习心得之:C#语言基础

    一.HelloWorld 我们先来看看最简单的C#代码——HelloWorld: using System; using System.Collections.Generic; using Syste ...

  4. Android中使用logwrapper来重定向应用程序的标准输出

    在Android应用程序调试中,有时候第三方应用程序的日志输出是通过printf之类的标准函数输出的,logcat不能捕获这些日志,一个方法是使用logwrapper命令来执行第三方应用程序,logw ...

  5. eclipse gradle 自动打包

    直接在eclipse项目中建立一个文件,文件名为build.gradle.其实还可以用eclipse再项目上面右击,export->Android->Generate Gradle bui ...

  6. [WebService]之JWS_1

    创建JWS项目步骤: 1:创建接口 2:创建实现类 3:开启服务 1:编写接口 @WebService public interface IMyService { public int add(int ...

  7. 搭建sql注入实验环境(基于windows)

    搭建服务器环境 1.下载xampp包 地址:http://www.apachefriends.org/zh_cn/xampp.html 很多人觉得安装服务器是件不容易的事,特别是要想添加MySql, ...

  8. Ubuntu 创建开机自启动脚本的方法

    http://askubuntu.com/questions/9382/how-can-i-configure-a-service-to-run-at-startuphttp://stackoverf ...

  9. reds pub/sub官方文档翻译

    Publish / Subscribe发布/订阅 redis-py includes a PubSub object that subscribes to channels and listens f ...

  10. jxse2.6在jdk8下,JxtaMulticastSocket存在的问题

    JxtaMulticastSocket覆写了java.net.MulticastSocket的bind方法: @Override public void bind(SocketAddress addr ...