【问题标题】:How to get the point(CGPoint) of the selected sectionIndexTitle如何获取所选sectionIndexTitle的点(CGPoint)
【发布时间】:2019-03-29 05:15:05
【问题描述】:

如何在tableView中获取所选sectionIndexTitle的点(CGPoint)?我没有找到任何方法来实现这一点。

- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index {
    //How to get the point of the selected sectionIndexTitle
    return index;
}

有没有办法获取选中的sectionIndexTitle 对象?所以我可以访问它的框架并改变它的颜色。

【问题讨论】:

  • get point 表示 CGPoint 或 else
  • @Anbu.Karthik 是的,point就是CGPoint,我已经编辑了描述;
  • 我不确定,在这里我们可以。得到

标签: ios objective-c uitableview


【解决方案1】:

您可以做一件事来获取单元格的 CGpoint。创建一个块,每当用户点击单元格时。使用以下代码获取 CGPoints

让 touchPoint = CGPoint(x: cell.center.x, y: cell.center.y)

【讨论】:

  • 感谢您的回答,但我想得到的是所选 sectionIndexTitle 的 CGPoint,而不是单元格。
猜你喜欢
  • 2012-05-20
  • 1970-01-01
  • 2012-10-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-01-06
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多