`

说说值得下功夫的iphone控件-2

 
阅读更多
tableviewController
或者是继承ViewController<tableview的两个协议>

类似android中的listView。最经典的MVC设计思路的控件之一
首先要完成TableView模型的两个方法
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
}//tableView模型的行数

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
}//每一行的单元显示
//比较蛋疼的还可以试试别的方法比如添加多少列。点击效果等等,但是上面两个必须要实现


下面实现控制部分。单机每一行实现的方法
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
}
//基本上比较高级的控件都是沿着这种mvc设计思路,剩下的操作就是在xib上拖着控件慢慢玩吧
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics