【问题标题】:Need to fire didSelectRowAtIndexPath from within a UITextField in custom cell需要从自定义单元格中的 UITextField 中触发 didSelectRowAtIndexPath
【发布时间】:2009-12-27 13:40:20
【问题描述】:

我需要触发这个函数 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{}

当 UITableView 中的自定义单元格的 UITextField 被选中时,到目前为止它只在行被选中时触发。

谢谢。

【问题讨论】:

    标签: iphone


    【解决方案1】:

    如果您只是想知道用户何时点击了您的字段,然后为该字段的行触发 -tableView:didSelectRowAtIndexPath:,只需关闭该字段的 userInteractionEnabled。点按将“直通”到底层行,这将执行您想要的操作。

    【讨论】:

      【解决方案2】:

      不,那不是我想要本。我设法通过触发 EditBegin 并将 UITextField 标记作为行号来解决它。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-01-06
        相关资源
        最近更新 更多