ios – accessoryButtonTappedForRowWithIndexPath不适用于自定义按钮或标签

ios – accessoryButtonTappedForRowWithIndexPath不适用于自定义按钮或标签,第1张

概述override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let key = keyArray[indexPath.section-1] let label = UILabel(frame: CGRec
overrIDe func tableVIEw(tableVIEw: UItableVIEw,cellForRowAtIndexPath indexPath: NSIndexPath) -> UItableVIEwCell {      let key =  keyArray[indexPath.section-1]      let label = UILabel(frame: CGRectMake(0,26,28))      label.center = CGPointMake(26,28)      cell.accessoryVIEw = label}    overrIDe func tableVIEw(tableVIEw: UItableVIEw,accessorybuttonTappedForRowWithIndexPath indexPath: NSIndexPath) {        print(indexPath)    }

为什么自定义标签或自定义按钮不能调用accessorybuttonTappedForRowWithIndexPath.或者只有一种方法将mybutton添加到单元格?

解决方法 对于自定义按钮,您可以为特定事件添加目标,accessorybuttonTappedForRowWithIndexPath将不适用于自定义视图

请参考:

总结

以上是内存溢出为你收集整理的ios – accessoryButtonTappedForRowWithIndexPath不适用于自定义按钮或标签全部内容,希望文章能够帮你解决ios – accessoryButtonTappedForRowWithIndexPath不适用于自定义按钮或标签所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1073991.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-26
下一篇 2022-05-26

发表评论

登录后才能评论

评论列表(0条)

保存