在iOS中未调用tableview DidSelectRowatinex路径
我有一个自定义uiview,将tableview添加到其中作为我的子视图。我以编程方式创建了tableview。当我点击我的按钮时,tableview会显示填充的列表,但问题是没有调用didselectrowatindexpath。cellforrowatindexpath正在被调用 这是我的密码在iOS中未调用tableview DidSelectRowatinex路径,ios,tableview,Ios,Tableview,我有一个自定义uiview,将tableview添加到其中作为我的子视图。我以编程方式创建了tableview。当我点击我的按钮时,tableview会显示填充的列表,但问题是没有调用didselectrowatindexpath。cellforrowatindexpath正在被调用 这是我的密码 -(void)viewDidLoad { tblNetBanking = [self makeTableView]; [self.tblNetBanking registerClass:[U
-(void)viewDidLoad
{
tblNetBanking = [self makeTableView];
[self.tblNetBanking registerClass:[UITableViewCell class] forCellReuseIdentifier:@"newFriendCell"];
[self.customview addSubview:tblNetBanking];
}
-(UITableView *)makeTableView
{
CGFloat x = 0;
CGFloat y = 0;
CGFloat width = self.view.frame.size.width;
CGFloat height = self.view.frame.size.height - 50;
CGRect tableFrame = CGRectMake(x, y, width, height);
UITableView *tableView = [[UITableView alloc]initWithFrame:tableFrame style:UITableViewStylePlain];
tableView.rowHeight = 45;
tableView.sectionFooterHeight = 22;
tableView.sectionHeaderHeight = 22;
tableView.scrollEnabled = YES;
tableView.showsVerticalScrollIndicator = YES;
tableView.userInteractionEnabled = YES;
tableView.bounces = YES;
tableView.delegate = self;
tableView.dataSource = self;
return tableView;
}
//and on my button click
-(IBAction)netbanking
{
tblNetBanking.hidden=NO;
txtCreditCardNumber.hidden=YES;
btnNetBankingCancel.hidden=NO;
txtCreditExpiryDate.hidden=YES;
txtCreditNickName.hidden=YES;
btnCreditCardSave.hidden=YES;
btnScanCreditCardNo.hidden=YES;
txtDebitCardNumber.hidden=YES;
txtDebitExpiryDate.hidden=YES;
txtDebitNickName.hidden=YES;
btnScanDebitCardNo.hidden=YES;
btnDebitCardSave.hidden=YES;
}
您是否在此屏幕上使用任何
手势识别器
在某些情况下,
UIGestureRecognizers
拦截触摸和选择,而该代理不会调用。在接口MyClass
之后,请确保您有
。
此外,如果您编写了DidSelectRowAtIndexPath的代码,请检查是否有任何输入错误
我们可以看到您的
DidSelectRowAtIndexPath
code吗?确保您实现了Did Select Row
notDid Deselect Row
方法。@Rani NSLog(@“%@”,tblNetBanking.delegate);检查其返回值为零。您能否详细说明一下您的CellForRowatineXpath
的实现情况?谢谢@krivoblotsky。有一个手势识别器正在拦截我的选择。非常感谢