在 Xamarin.iOS 中使用 UITableViewCell 放松 Segue [英] Unwind Segue with UITableViewCell in Xamarin.iOS

查看:28
本文介绍了在 Xamarin.iOS 中使用 UITableViewCell 放松 Segue的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以明确地告诉我使用 Unwind SeguesUITableViewCell 是否有限制,或者如果没有如何实现这一点?

Can someone tell me definitively if there is a limitation with using Unwind Segues with UITableViewCell or if not how to achieve this?

我可以成功地实现从我的第二个视图控制器到我的第一个视图控制器的 unwind segue - 使用简单的 UIButton 触发.

I can successfully implement an unwind segue from my second view controller to my first - triggered using a simple UIButton.

但是,当我尝试使用 UITableViewCell 创建展开转场(从 TableViewCell 拖动到绿色退出图标时,我没有获得 UITableViewCell 的选项strong>Action Segue.相反,我获得了 Selection Segue"Accessory Action" 的选项.

However, when I try to use a UITableViewCell to create the unwind segue (drag from the TableViewCell to the green Exit icon then I do not get an option for Action Segue. Instead I get options for "Selection Segue" and "Accessory Action".

如何在选择 UITableViewCell 时触发展开转场?

How can I trigger the unwind segue on selection of a UITableViewCell?

推荐答案

好的.我对我在这里的错误感到有点尴尬.我没有为我的 UITableView 创建一个插座,而是使用我通过我的 ViewController 中的代码创建和添加的 tableview.因此,我在故事板上连接到 UITableViewCell 的场景退出"从未被调用(因为它连接到的 UITabelViewCell 不是应用程序运行时可见的那个)

Ok. I'm a little embarrassed at my error here. I hadn't created an outlet for my UITableView and was instead using a tableview that I had created and added through code in my ViewController. Therefore the "Scene Exit" that I hooked up to the UITableViewCell on my storyboard was never being called (because the UITabelViewCell that it was hooked up to was not the one that was visible when the app ran)

我只是为表格视图创建了一个出口并使用了它,一切都很好.我会把它归结为我的新手状态:-/

I simply created an outlet to the table view and used that and all was fine. I'll put it down to my newbie status :-/

这篇关于在 Xamarin.iOS 中使用 UITableViewCell 放松 Segue的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆