我正在为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];
答案 0 :(得分:1)
尝试设置keyPadContainer.opaque = NO