ios - 没有在 popupView 中调用 UITableview 的 didSelectRowAtIndexPath

标签 ios objective-c iphone uitableview popover

我在 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 with DataSource or Delegate

Note: Not used any Gesture in my viewController.

我认为层有一些问题所以我也应用了 zPosition,但是没有用..

编辑 我只是在 textField 编辑上使 popOver view.hidden = true 或 false..

有什么解决办法吗?

最佳答案

在运行应用程序时检查您的 tableview 是否在前面。

enter image description here

关于ios - 没有在 popupView 中调用 UITableview 的 didSelectRowAtIndexPath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35794008/

相关文章:

iphone - 使用 xCode4 将应用程序提交到应用程序商店 - 关键步骤摘要 - 请更正/添加

ios - Core Data 合成的是类别而不是类,为什么?

ios - 如何使用 AVMutableComposition iOS Swift 合并 mp4 和 MOV 类型的视频?

ios - 在 Objective-C 应用程序中集成 Swift 项目

ios - 向 ios 应用程序添加永久 NSDictionary

iphone - Facebook iPhone 应用程序使用什么来显示应用程序中的页面?

ios - 包含正斜杠/和 HTML 的字符串的 NSJSONSerialization 序列化被错误地转义

ios - Objective-C 应用程序更新和核心数据

objective-c - 正确使用 Objective C++

iphone - 如何上传从 UIImagePickerController 获取的图像