Jac*_*cek 21 iphone transparency background uitableview
我想让分组的UITableView透明化.我部分成功使用以下代码:
UIColor *bgColor = [[UIColor alloc] initWithWhite:1 alpha:0.0];
historyTable.backgroundColor = bgColor;
Run Code Online (Sandbox Code Playgroud)
不幸的是,圆角单元格中出现黑角.如何摆脱它们?
之前http://i49.tinypic.com/2iaa05u.jpg 之后http://i45.tinypic.com/2cnvckk.jpg
Tom*_*ing 37
而不是使用
UIColor *bgColor = [[UIColor alloc] initWithWhite:1 alpha:0.0];
historyTable.backgroundColor = bgColor;
Run Code Online (Sandbox Code Playgroud)
只需使用:
historyTable.backgroundColor = [UIColor clearColor];
Run Code Online (Sandbox Code Playgroud)
这也清除了你正在创建的内存泄漏.
小智 35
删除UITableView backgroundView
xxx.backgroundView = nil;
Run Code Online (Sandbox Code Playgroud)
这在iPad版本中是必需的.编译在iPad和iPhone上运行时,检查tableView是否响应选择器...
if ([self.tableView respondsToSelector:@selector(setBackgroundView:)]) {
[self.tableView setBackgroundView:nil];
}
Run Code Online (Sandbox Code Playgroud)
对我来说,它设置为nil/clear之后最终完成了:
[myTableView setBackgroundView:nil];
[myTableView setBackgroundColor:[UIColor clearColor]];
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
20359 次 |
最近记录: |