gpt4 book ai didi

ios - 如何在 iOS 的 UITableViewCell 右侧放置另一个 TextLabel

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:46:30 26 4
gpt4 key购买 nike

我想在 iOS 中 UITableViewCell 的右侧放置另一个 Cell 文本,如下图所示。

enter image description here

我该怎么做?

感谢您的帮助。

最佳答案

UITableViewCell 有一个属性,detailTextLabel,对应你查询的文本标签。只需将文本分配给该标签

  cell.textLabel.text = @"Google";
cell.detailTextLabel.text= @"Yesterday";

此外,小“箭头”是单元格的附属 View

  cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

关于ios - 如何在 iOS 的 UITableViewCell 右侧放置另一个 TextLabel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17218055/

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