>我想将分隔符从UITableView更改为虚线。我能找到的只是UITableViewCellSeparatorStyleBlabla...
我可以放别的东西吗?我宁愿不使用图像,但是如果没有其他方法...
谢谢!
请尝试以下解决方案:
self.tableView.separatorColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"Dottedlineimage"]];
注意:D不要忘记在以下两种解决方案中关闭表视图的默认分隔符样式:[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];
H appy 帮忙:)
我认为没有分隔符作为虚线。您可以通过将图像附加到自定义单元格的末尾来创建自己的分隔符。