您的位置:首页 > 产品设计 > UI/UE

UITableView 中实现 滑动一个cell 显示一个按钮,并且做相关业务处理

2013-05-28 17:51 435 查看
//当在Cell上滑动时会调用此函数
-(void) tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"点击了收藏,开始收藏功能");
NSUInteger row = [indexPath row];
NSDictionary * rowData =  [itemArray objectAtIndex:row];
NSLog(@"准备收藏的路段名称是:%@", [[NSString alloc]initWithFormat:@"%@",[rowData objectForKey:@"road_name"] ]);
}

/*此时删除按钮为Delete,如果想显示为“删除” 中文的话,则需要实现
UITableViewDelegate中的- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath方法*/

- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath{
return @"收藏";
}

相关 文章 http://code.eoe.cn/476.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐