我正在使用自定义单元格并添加tableview编程。我正在尝试在我的应用程序中实施轻扫功能。当我尝试滑动时,不会调用tableview数据源方法。刷卡删除不适用于自定义单元格
tableview = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 320, 460) style:UITableViewStylePlain];
tableview.delegate=self;
tableview.dataSource=self;
tableview.backgroundColor=[UIColor clearColor];
tableview.backgroundColor=selectedBackGroundColor;
tableview.separatorColor = [UIColor clearColor];
tableview.editing=YES;
NSLog(@"%f %f",self.view.frame.size.width,self.view.frame.size.height);
[self.view addSubview:tableview];
这种方法,即使细胞也没有选择......我失去了任何事情的代码,请帮我出后调用
-(UITableViewCellEditingStyle)tableView:(UITableView*)tableView editingStyleForRowAtIndexPath:(NSIndexPath*)indexPath
{
return UITableViewCellEditingStyleDelete;
}
?
添加了一个子?您是否已将视图添加到内容视图?您的视图是否会自动调整为父级? – rckoenes
是的,我在我的自定义内容视图中添加了一个标签和一个图片。 – Srinivas
我评论了所有标签,我在自定义cell.even中添加了相同内容。如果我刷卡然后didselectRow ForIndexpath也没有调用... – Srinivas