【问题标题】:UITextField InputView background color issue in iOS7iOS7中的UITextField InputView背景颜色问题
【发布时间】:2014-01-06 10:49:42
【问题描述】:

我正在为 UITextField 使用自定义键盘。所以我将自定义视图分配给 TextField inputView 属性。 CustomView背景色在iOS7中显示为blackcolor,比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];

【问题讨论】:

    标签: ios iphone ipad ios6 ios7


    【解决方案1】:

    尝试设置keyPadContainer.opaque = NO

    【讨论】:

    • 不走运,还是同样的问题。
    • 但有时会在 [[backdropView layer] setOpacity:0] 处崩溃;当我展示一个视图控制器并关闭它时。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-12-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-10
    • 2018-04-20
    相关资源
    最近更新 更多