UIAlertView
消息框在编辑其中的文本字段(即键盘显示时)时无法正常显示。下面是它的样子:
![enter image description here](https://istack.dev59.com/N0o0O.webp)
![enter image description here](https://istack.dev59.com/7WSwW.webp)
UIAlertView *alertView = [[UIAlertView alloc]
initWithTitle:@"Title"
message:@"Enter a name for your recipe"
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"OK", nil];
[alertView setAlertViewStyle:UIAlertViewStylePlainTextInput];
[alertView show];
有没有一种方法可以更改视图中某些组件的大小,以便在显示键盘时适合屏幕?
编辑:我刚刚发现,当键盘出现时,警报视图会变为可滚动。因此,如果您向下滚动,就可以看到消息。但是,第一次弹出警报视图时我没有注意到这一点,其他用户也可能不会。目前,我正在使用Visput建议的方法。