gpt4 book ai didi

iphone - 如何实现包含行和列的表格

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

如何实现如图所示的表格?带行和列的表?任何人都可以告诉我 iphone 的引用

enter image description here

最佳答案

这些列只是一种错觉。

这是通过子类化 UITableViewCell 并将单元格设计为具有一个 UIImageView 和三个 UILabel 来完成的。

将 imageView 和标签分配给子类的属性,您可以这样配置...

Object *object = [self.datasource objectAtIndexPath:indexPath];

cell.imageView.image = object.image;
cell.subCategoryLabel.text = object.subcategory;
cell.dateLabel.text = object.dateString;
cell.scoreLabel.text = [NSString stringWithFormat:@"%i", object.score];

或类似的东西。

然后标签的布局给人一种有列的错觉。

关于iphone - 如何实现包含行和列的表格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13489274/

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