iOS7中的UITextField InputView背景颜色问题

时间:2013-12-18 10:07:46

标签: ios iphone ipad ios6 ios7

我正在为UITextField使用自定义键盘。所以我将自定义视图分配给TextField inputView属性。在iOS7中,CustomView背景颜色显示为黑色,与iOS7相比,它是clearColor。代码和屏幕截图(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 Screenshot

iOS7 Screenshot

1 个答案:

答案 0 :(得分:1)

尝试设置keyPadContainer.opaque = NO