简体   繁体   English

iOS7中的UITextField InputView背景色问题

[英]UITextField InputView background color issue in iOS7

I am using a custom keyboard for UITextField. 我正在为UITextField使用自定义键盘。 So i am assigning the custom view to the TextField inputView property. 所以我将自定义视图分配给TextField inputView属性。 The CustomView background color appears as blackcolor in iOS7, where it is clearColor lessthan iOS7. CustomView背景色在iOS7中显示为黑色,比iOS7的clearColor少。 Code and screenshots(iOs6,iOS7) is below: 代码和屏幕截图(iOs6,iOS7)如下:

keypadContainer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, appFrame.size.width, appFrame.size.height - ((self.view.frame.origin.y + self.view.bounds.size.height) - kp.bounds.size.height))];
    keypadContainer.backgroundColor=[UIColor clearColor];
    [keypadContainer addSubview:buttonsView]; //Here buttonsView is the view which conatins buttons for 0 to 9 digits.

    numberField.inputView = keypadContainer;
    numberField.inputView.backgroundColor=[UIColor clearColor];

iOS6截图

iOS7屏幕截图

尝试设置keyPadContainer.opaque = NO

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM