我想将分隔符从 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/