2

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,

Kirit Modi
  • 23,155
  • 15
  • 89
  • 112
srivas
  • 299
  • 4
  • 10

2 Answers2

2

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

Dharma
  • 3,007
  • 3
  • 23
  • 38
0

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

Community
  • 1
  • 1
thandasoru
  • 1,558
  • 2
  • 15
  • 41
  • After exploring the linked answer you provided, I found that you can change the color of a UIAlertController's button, but not the font. – peacetype Nov 04 '15 at 22:17