srivas
srivas

Reputation: 319

How to decrease the Font size of a button in UIAlertView,is there any way to do so?

i am using UIalertView,

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:appname
                                                message:@"some blah blah!"
                                               delegate:nil
                                      cancelButtonTitle:@"Ok"
                                      otherButtonTitles:@"Free content", nil];
[alert show];

here i want to reduce the font size of "Free content" when alert view pops up(something like arial-9)font,is there any way to reduce the font or design it in a custom way?

thanks,

Upvotes: 2

Views: 1379

Answers (2)

Dharma
Dharma

Reputation: 3013

You cannot customize the appearance of UIAlertView,

because the view hierarchy for this class is private and must not be modified.

for more see UIAlertView Class Reference:UIAlertView Class Reference:

why not?

you can use Custom AlertView with desire apperance

see the below link how to create custom alertviews with your desired apperance CustomAlertView Sample

Upvotes: 2

thandasoru
thandasoru

Reputation: 1558

UIAlertView is deprecated as of iOS 8. You need to use UIAlertController from iOS8 onwards. You can use Key-Value coding to set UIAlertController's button font using attributedTitle key.

More on the answer provided here.

UIAlertController custom font, size, color

Upvotes: 0

Related Questions