Fer*_*vus 4 iphone cocoa-touch
我想将分隔符从UITableView更改为虚线.我能找到的只是UITableViewCellSeparatorStyleBlabla ...
我可以换一些东西吗?我宁愿不使用图像,但如果没有别的办法......
谢谢!
Alo*_*lok 10
尝试以下解决方案:
self.tableView.separatorColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"Dottedlineimage"]];
Run Code Online (Sandbox Code Playgroud)
注意:不要忘记在两个解决方案中关闭表视图的默认分隔符样式:[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];
Run Code Online (Sandbox Code Playgroud)
乐于帮助:)
| 归档时间: |
|
| 查看次数: |
4632 次 |
| 最近记录: |