我正在为UITextField使用自定义键盘。所以我将自定义视图分配给TextField inputView属性。 CustomView背景色在iOS7中显示为黑色,比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];
最佳答案
尝试设置keyPadContainer.opaque = NO
关于ios - iOS7中的UITextField InputView背景颜色问题,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/20655093/