我正在使用自定義單元格並添加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