Disclosure Indicator 不调用 seque 而 Detail Disclosure 调用

Posted

技术标签:

【中文标题】Disclosure Indicator 不调用 seque 而 Detail Disclosure 调用【英文标题】:Disclosure Indicator doesn't call seque while Detail Disclosure does 【发布时间】:2014-06-08 04:36:59 【问题描述】:

我有一个有趣的问题。当人们单击表格视图中的箭头时,我希望弹出详细信息屏幕。细胞是动态的。

当我选择 Disclosure Indicator 时 - 我没有调用 segue,也没有调用 accessoryButtonTappedForRowWithIndexPath。当我将其更改为 Detail Disclosure 时,一切正常。

我可以做些什么来使披露指示器像详细披露一样起作用?

谢谢!

【问题讨论】:

【参考方案1】:

披露指示器不是按钮,因此不会触发tableView:accessoryButtonTappedForRowWithIndexPath: 委托方法,而详细披露按钮,因此会触发该方法。

我想,你能做的最好的事情就是在你的表格视图单元格中添加一个UIButton,并给它一个非常类似于默认表格视图披露指示器的图像。不过,这是一种 hacky 解决方案,所以我不鼓励您实际这样做。

【讨论】:

在 Mint 和其他应用程序中完成“点击箭头”的最佳做法是什么? @mikebz 据我所知,Mint 应用程序中没有“点击箭头”功能。似乎点击任何显示箭头与点击单元格本身所做的事情相同,这可能会调用tableView:didSelectRowAtIndexPath: 来执行segues 或做其他事情。所以基本上最好的做法是不要让披露指示器可以点击,而是利用单元格选择机制,如果你想为一个项目提供一个单独的细节视图,那么使用细节披露附件类型。

以上是关于Disclosure Indicator 不调用 seque 而 Detail Disclosure 调用的主要内容,如果未能解决你的问题,请参考以下文章

在 Disclosure 指示器后面的 TableViewCell 中将 ImageView 设置为全宽

Panda Games: Corporate Disclosure in the Eclipse of Search

Lab: Information disclosure on debug page:页面调试信息公开

TabLayout设置下划线(Indicator)宽度

cocos studio pageview看不到indicator指示点

如何制作 Plotly Indicator 仪表的网格?