我在 textField onEditing 事件中打开其中包含 Tableview 的 popupView。
我正在为 tableview 设置 DataSource 和 Delegate。 我已经为 Tableview 设置了这么多属性
1) 允许选择 = 是
2) userInterectionEnabled = 是
3) tableview.layer.zposition = 1
4) [self.view bringSubViewToFront: tableview]
这是代码..
UITableView *tblCompany = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, [UtilClass getScreenWidth]-[UtilClass getScreenWidth]/4, 200)];
tblCompany.dataSource = self;
tblCompany.delegate = self;
tblCompany.userInteractionEnabled=YES;
tblCompany.allowsSelection=YES;
tblCompany.separatorStyle=UITableViewCellSeparatorStyleNone;
[self.popOver addSubView:tblCompany];
我的问题
我的 viewController 中有许多控件,例如按钮和标签。 当我编辑我的文本字段时,弹出窗口会在按钮上方打开。
当我尝试单击 tableView 的单元格时,它不会调用 didSelectRowAtIndexPath
但我单击了它后面的按钮。
Note:
cellForRowAtIndexPath
,numberOfRowsInSection
,heightForRowAtIndexPath
these all are working fine, so there is no problem withDataSource
orDelegate
Note: Not used any
Gesture
in my viewController.
我认为层有一些问题所以我也应用了 zPosition,但是没有用..
编辑 我只是在 textField 编辑上使 popOver view.hidden = true 或 false..
有什么解决办法吗?
最佳答案
关于ios - 没有在 popupView 中调用 UITableview 的 didSelectRowAtIndexPath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35794008/