我有一个UITableView,我想将其背景颜色设置为透明.表视图的背景颜色和界面构建器的所有子视图都设置为透明.它适用于iOS 8& 7.但是,不是iOS 9.任何想法?
cellForRowAtIndexPath方法:
[cell setSelectedBackgroundView:[[UIView alloc] init]]; [cell.selectedBackgroundView setBackgroundColor:[UIColor clearColor]]; [cell setBackgroundColor:[UIColor clearColor]]; [cell.contentView setBackgroundColor:[UIColor clearColor]]; [cell setBackgroundView:[[UIView alloc] init]]; [cell.backgroundView setBackgroundColor:[UIColor clearColor]];
解决方法
Objective-C的:
[self.yourTableView setBackgroundColor:[UIColor clearColor]];
迅速:
self.yourTableView.backgroundColor = .clear
XCode 7.0错误.没有从Storyboard中获取
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。