首页 > 试题广场 >

UITableView需要实现哪些代理?列出UITableV

[问答题]
UITableView需要实现哪些代理?列出UITableView代理中必须实现的与其他一些常用的函数。

一组有多少行和每一行的cell需要实现,一共有多少组不重写默认为1

发表于 2015-05-07 09:39:32 回复(0)
按command 点开 UITableView可以看见 楼上说的
numberForRowsInSection:
cellForRow
是必须的,其余都是optional
常用的,点开 一清二楚
发表于 2015-02-10 21:15:05 回复(0)
- ( NSInteger )tableView:( UITableView *)tableView numberOfRowsInSection:( NSInteger )section;
一组有多少行

- ( UITableViewCell *)tableView:( UITableView *)tableView cellForRowAtIndexPath:( NSIndexPath *)indexPath;
每行中的cell的实现
以上两个方法为必须要实现的

常用的有
- ( void )tableView:( UITableView *)tableView didSelectRowAtIndexPath:( NSIndexPath *)indexPath
选中以后事件设置
- ( CGFloat )tableView:( UITableView *)tableView heightForRowAtIndexPath:( NSIndexPath *)indexPath
设置cell的高度
等等。。。。。
发表于 2015-08-04 19:18:00 回复(0)
delegate 和datasource
必需的
cellForRowAtIndexpath
heightForRowAtIndexpath
numberOfRowsInSection
其他常用的如:
selectRowAtIndexpath
numberofselectionsInTableview
编辑于 2015-05-12 08:46:37 回复(0)
查看源代码,@required是必须要实现的,@optional则是选择性实现的。
发表于 2015-05-04 11:41:34 回复(0)
发表于 2015-05-02 14:16:18 回复(0)
numberOfRowsInSection

cellForRowAtIndexPath


发表于 2015-04-29 17:35:19 回复(0)
UITableViewDeleagate 和UITableViewDataSource
必须实现的方法

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

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


发表于 2015-04-28 20:59:52 回复(0)
numberForRowsInSection:
cellForRow
发表于 2015-01-21 14:30:24 回复(0)