UIKeyboard在iOS7中不会自动半透明 [英] UIKeyboard not automatically translucent in iOS7

查看:130
本文介绍了UIKeyboard在iOS7中不会自动半透明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,在Xcode 5和iOS 7项目中进行开发时,与UITextField交互时弹出的键盘应该是半透明的,并通过背景中的任何颜色显示。在我的两个项目中都不是这种情况。我有一个彩色&模糊的背景,我希望通过键盘发现;但键盘仍然是默认的白色/灰色。

I understand that when developing in Xcode 5 with and iOS 7 project, the keyboard that pops up when interacting with a UITextField should be translucent and show through any colors in the background. This is not the case in both my projects. I have a colored & blurred background and I'm hoping for that to transpire through the keyboard; however the keyboard remains the default white/gray.

这就是我演示的内容:

UIColor *tintColor = [UIColor colorWithWhite:0.21 alpha:0.4];
UIColor *background = [[UIColor alloc] initWithPatternImage:[[UIImage imageNamed:@"universe.jpg"] applyBlurWithRadius:19
                                                                                                            tintColor:tintColor
                                                                                                saturationDeltaFactor:1.8
                                                                                                            maskImage:nil]];
self.view.backgroundColor = background;

UITextField *text = [[UITextField alloc] initWithFrame:CGRectMake(200, 200, 300, 60)];
[self.view addSubview:text];

我甚至尝试将键盘外观类型设置为UIKeyboardAppearanceDefault和UIKeyboardAppearanceLight

I have even tried to set the keyboard appearance type to both UIKeyboardAppearanceDefault and UIKeyboardAppearanceLight

有人可以指导/告诉我如何实现键盘半透明效果?这应该是自动的吗?
谢谢

Can someone please guide/tell me on how can I achieve the keyboard translucent effect? Should this be automatic? Thanks

编辑1:

我有iPad mini我有iPad第3代和iPad第4代都带有视网膜显示器。
运行iOS 7.0.2

I have the iPad mini, I have the iPad 3rd generation and the iPad 4th generation both with retina displays. Running iOS 7.0.2

推荐答案

我构建了一个简单的应用程序来测试以试图找到这个问题,但我除了将IPHONEOS_DEPLOYMENT_TARGET设置为较低的版本号(如6.0),然后在iOS 6.0上运行之外,它已无法复制它。在所有情况下,在所有iOS 7设备和模拟器上,默认键盘下面的内容都是半透明的模糊。

I built a simple app to test to try to find this issue, but I've been unable to replicate it except by setting IPHONEOS_DEPLOYMENT_TARGET to a lower version number like 6.0, then running on iOS 6.0. In all cases, on all iOS 7 devices and simulator, the default keyboard has a translucent blur of the content underneath it.

也许你可以分享图片或样本项目?

Perhaps you could share a picture, or a sample project?

这篇关于UIKeyboard在iOS7中不会自动半透明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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