gpt4 book ai didi

iphone - UITableView 单元格用虚线分隔

转载 作者:行者123 更新时间:2023-12-03 19:05:23 26 4
gpt4 key购买 nike

我想将分隔符从 UITableView 更改为虚线。我能找到的只是UITableViewCellSeparatorStyleBlabla...

我可以用别的东西代替吗?我宁愿不使用图像,但如果没有其他方法......

谢谢!

最佳答案

尝试以下解决方案:

self.tableView.separatorColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"Dottedlineimage"]];   

注意:不要忘记在两个解决方案中关闭表格 View 的默认分隔符样式:[ self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];

======================或者试试这个======================== ===================

UIImageView *aLine = [[UIImageView alloc] initWithFrame:CGRectMake(cell.frame.origin.x, cell.frame.origin.y, cell.frame.size.width, cell.frame.size.height)];
[aLine setImage:[UIImage imageNamed:@"yourDottedImage.png"]];
[cell.contentView addSubview:aLine];
[aLine release];

非常乐意提供帮助:)

关于iphone - UITableView 单元格用虚线分隔,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10261602/

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