如何使用SDK 7在iOS 7上设置UIPickerView的背景颜色? [英] How to set the background color of UIPickerView on iOS 7 using SDK 7?

查看:127
本文介绍了如何使用SDK 7在iOS 7上设置UIPickerView的背景颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用SDK 7在iOS 7 上设置 UIPickerView 的背景颜色,并在iOS 5和6上使用标准选择器 ?默认情况下,它在iOS 7上是透明的。

How to set the background color of UIPickerView on iOS 7 using SDK 7 and use a standard picker on iOS 5 and 6? It's transparent by default on iOS 7.

推荐答案

我添加了 UIView UIPickerView 下代码:

CGRect framePickerView = CGRectMake(0, self.view.frame.size.height, self.view.frame.size.width, 216);
pickerView = [[[UIView alloc] initWithFrame:framePickerView] autorelease];
pickerView.backgroundColor = [UIColor whiteColor];
[self.view addSubview:pickerView];
[pickerView addSubview:picker];

而不是代码:

[self.view addSubview:picker];

这篇关于如何使用SDK 7在iOS 7上设置UIPickerView的背景颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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