UIAlertController
にはUITextField
が入力されていますが、何らかの理由でテキストフィールドがそれよりもはるかに小さいようです。どんな考え?ここでUIAlertControllerテキストフィールドの幅が通常よりも小さく
はここでスクリーンショット
あるコードは
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];
感謝です!これは非常に興味深いバグだった
[[[[[UIApplication sharedApplication] delegate] window] rootViewController] presentViewController:alertController animated:YES completion:nil];
iphone 6プラスに私と一緒に正常に動作します。 –
あなたのコードに何も問題はありません。 –
それは私のためにも働いた。私はちょうどそれがどのように見えるかを示すためにスクリーンショットを共有しましたが、2つの投票を得ました:)私の投稿を削除しました。それは答えではありませんが、私は同意します。 – Abhinav