【发布时间】:2014-01-29 02:56:35
【问题描述】:
我有一个带有UIInputView 输入附件视图的文本字段。
当我点击我的文本字段时,键盘飞入视图,我可以看到辅助视图的子视图,但它没有可见的背景。 键盘动画完成后,UIInputView 的背景就会弹出。
当键盘动画仍在播放时,我可以做些什么来强制 UIInputView 的背景可见?
这是我的代码:
UIInputView *inputView = [[UIInputView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, CGRectGetWidth(self.bounds), 44.0f) inputViewStyle:UIInputViewStyleKeyboard];
UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
button.frame = CGRectInset(inputView.bounds, 15.0f, 2.0f);
[button setTitle:@"Button" forState:UIControlStateNormal];
[inputView addSubview:button];
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(0.0f, 0.0f, CGRectGetWidth(self.bounds), 44.0f)];
textField.inputAccessoryView = inputView;
[self addSubview:textField];
【问题讨论】:
-
也想在这里看到答案。这真是令人不安。
标签: objective-c ios7 uitextfield inputaccessoryview