So I have a UIAlertController
with a UITextField
added for an input but for some reason the textfield appears to be much smaller than it's supposed to be. Any idea why?
Here is the Screenshot
Here is the Code
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];
Thanks!
This was a very interesting bug. The project we were working on had a library called Pixate Freestyle, which uses CSS to style app's elements. It was breaking the textfields by styling it. We removed it from the project and styled it natively. The problem was solved. Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With