UITableView背景色iOS 9 [英] UITableView background color iOS 9

查看:54
本文介绍了UITableView背景色iOS 9的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个UITableView,我想将其背景色设置为透明.界面构建器中的表视图和所有子视图的背景色设置为透明.适用于iOS 8及更高版本; 7.但不是iOS 9.知道吗?

I have a UITableView that I want to set its background color to transparent. Background color for the table view and all subviews at interface builder is set to transparent. It works fine for iOS 8 & 7. but, not iOS 9. any idea?

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错误.不从情节提要中接听

XCode 7.0 bug. Not picking up from Storyboard

这篇关于UITableView背景色iOS 9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆