Reputation: 1862
I am using this code to show UIAlert which will ask simple input
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Alert" message:@"Message" preferredStyle:UIAlertControllerStyleAlert];
[alert addAction:[UIAlertAction actionWithTitle:@"Click" style:UIAlertActionStyleDefault handler:nil]];
[alert addTextFieldWithConfigurationHandler:^(UITextField *textField) {
textField.placeholder = @"Enter text:";
}];
[self presentViewController:alert animated:YES completion:nil];
Also tried this code of iOS 7
UIAlertView *alertViewCustomQuestion=[[UIAlertView alloc]initWithTitle:@"Custom Question" message:@"Please enter your custom question!" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Ok",nil];
alertViewCustomQuestion.alertViewStyle=UIAlertViewStylePlainTextInput;
[alertViewCustomQuestion show];
Both shows same result. While any example I saw has good width.
Upvotes: 2
Views: 237
Reputation: 3856
Just adding this as a reference for someone else in the future, who might stumble upon a similar problem.
I've had a identical problem as the OP in the question above, and in my case it turned out to be PixateFreestyle framework that is being used in the project I'm working on.
Apparently the framework is not being actively developed anymore, but fortunately there is kind of a FIX for the issue.
Upvotes: 0
Reputation: 1862
I was fixing bugs of someone's else code, Finally found there was some category that was changing its behavior.
Upvotes: 1