gpt4 book ai didi

objective-c - 如何控制表格单元格文本标签的位置?

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:20:33 25 4
gpt4 key购买 nike

我将如何放置单元格标签。这是我的 cell.detailTextLabel.text

cell.detailTextLabel.text = [[[placesOutputArray objectAtIndex:indexPath.row] childAtIndex:1] stringValue];

我在想一些类似的事情:

detailsLb = [[[UILabel alloc] initWithFrame:CGRectMake(40, 45, 250, 20)] autorelease];

我坚持以某种方式将两者合并在一起,以便将 cell.detailTextLabel.text 放置在我想要的位置。

谢谢你的帮助

最佳答案

您可以尝试以下方法:

  • 子类 UITableViewCell
  • 覆盖 super 方法“layoutSubviews”。就在那里,您可以简单地设置 detailTextLabel 的“frame”属性。

这应该可以解决问题。

关于objective-c - 如何控制表格单元格文本标签的位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11955631/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com