Pregunta

Why is the last item on my UIAlertView bold?

bold entry

I notice this happens on all of my Alert Views, regardless of weather or not I have a cancelButtonTitle or how many items I have in the alert view.

Does anyone know why this happens and how I can make all of the titles even?

- (IBAction)showGender:(id)sender {
UIAlertView *genAlert = [[UIAlertView alloc] initWithTitle:@"Select gender."
                                                   message:nil
                                                  delegate:self
                                         cancelButtonTitle:nil
                                         otherButtonTitles:@"Male", @"Female", @"Transgender", @"Unknown", nil];
genAlert.tag = 4;
[genAlert show];

}
¿Fue útil?

Solución

If no cancel button is set, Apple will set it to numberOfButtons - 1.

Try setting cancelButtonIndex to -1 and see if that helps.

W

EDIT: Well thats a pain. Since iOS7 I have been having lots of styling issues with the UIAlertView, specifically not being able to style it like previously. To help out I have made available a few files on github. Just drop them into your project and you will have a clone of UIAlertView that you can fully customise.

https://github.com/awgeorge/WGAlertView

W

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top