具有GroupTableViewBackgroundColor的iPad上的UIView [英] UIView on iPad with GroupTableViewBackgroundColor

查看:50
本文介绍了具有GroupTableViewBackgroundColor的iPad上的UIView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个UIView,我将其放到IB(iPad版)中的另一个UIView中,这样做是为了控制该区域的背景色.

I have a UIView that I have dropped inside of another UIView in IB (iPad version), I am doing this so I can control the background color of the region.

奇怪的是,如果我用IB或代码将UIView的背景色设置为GroupTableViewBackgroundColor,则该颜色始终为白色,它不考虑颜色变化,也不反映在IB中.

Odd thing is that if I set the background color of the UIView to GroupTableViewBackgroundColor, either in IB or code, the color is always white, it does not respect the color change, nor is it reflected in IB.

有人看到这种行为并找到了解决方法吗?

Has anyone seen this behavior and found a fix?

谢谢.

推荐答案

我想我知道您在说什么.您希望该视图与组表视图相同,即使它不是组表视图也是如此.这就是我所做的:

I think I know what you are saying. You want the view to be the same as a group table view even though it isn't a group table view. This is what I did:

UITableView *tv = [[UITableView alloc] initWithFrame:self.view.frame style:UITableViewStyleGrouped];
UIView *backgroundView = tv.backgroundView;
[self.view addSubview:backgroundView];
[tv release];
CGRect backgroundFrame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
[backgroundView setFrame:backgroundFrame];
[self.view sendSubviewToBack:backgroundView];

这篇关于具有GroupTableViewBackgroundColor的iPad上的UIView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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