Ширина текстового поля UIAlertController намного меньше обычной
Итак, у меня естьUIAlertController
сUITextField
добавлен для ввода, но по какой-то причине текстовое поле выглядит намного меньше, чем должно быть. Есть идеи почему?
Вот скриншот
Вот код
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"This is title"
message:@"This is message"
preferredStyle:UIAlertControllerStyleAlert];
[alert addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
textField.keyboardType = UIKeyboardTypeNumberPad;
textField.placeholder = @"I am a placeholder";
}];
UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"Submit"
style:UIAlertActionStyleDefault
handler:nil];
[alert addAction:okAction];
[self presentViewController:alert animated:YES completion:nil];
Спасибо!