UIViewController和UITextView在一起。这个TextView总是firstResponder。
- (void)viewDidLoad
{
[super viewDidLoad];
[self createBottomBar];
_textView.delegate = self;
[_textView becomeFirstResponder];
} 当用户点击“视频”按钮时,我的应用程序用文本字段显示UIAlertView
- (IBAction)showVideoPicker:(id)sender {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:_(@"Link to movie")
message:_(@"Insert a link to YouTube clip or a Coub")
delegate:self
cancelButtonTitle:_(@"Cancel")
otherButtonTitles:_(@"Attach"), nil];
alert.alertViewStyle = UIAlertViewStylePlainTextInput;
[alert show];
}当用户点击“附加”按钮警告,解散和键盘解散,然后立即显示。我想要另一个场景:键盘不要解散,因为文本视图应该始终是第一个响应者。只需UIAlertView解散wihout键盘解散/显示动画。
要了解更多信息,请参见gif 这里 (没有足够的声誉发布图片)。对不起我的英语。
发布于 2014-08-04 12:28:06
您是否尝试过通过UIAlertView委托在“附加”按钮上设置第一个响应程序?这是这里唯一的方法
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
if (buttonIndex == 1) [_textView becomeFirstResponder];
}键盘可能会跳一点,也可能不会跳一点,但这就是我们所拥有的。
https://stackoverflow.com/questions/25118637
复制相似问题