Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Danneman101

macrumors 6502
Original poster
Aug 14, 2008
361
1
Does the UIAlertView support changing its fontsize, and if so what method should I use?

Ive tried systemFontOfSize, for instance, but it seems not to be a UIAlertView-property...
 

Danneman101

macrumors 6502
Original poster
Aug 14, 2008
361
1
Well, Im constructing a text-intensive app so Ive implemented a fontsize-modifier in the settings which works fine for most text. There are a total of 5 fontsizes: 12, 14, 16, 18 and 20 px.

However, the standard fontsize for the uialertview seem to be 16, which is fine, I guess. But since I use a fair amount of alerts in my app (for help-sections) it kind of breaks the homogeneity of the layout when the user has an other fontsize as standard.
 

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
Well, if you need that much control, you may need to consider subclassing UIAlertView (or UIActionSheet) or maybe even UIView to achieve the customization you desire.
 

Danneman101

macrumors 6502
Original poster
Aug 14, 2008
361
1
When you say subclassing in this context, do you mean for instance adding a textview (or some other class that gives you control over the text-content) to the uialertview?
 

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
When you say subclassing in this context, do you mean for instance adding a textview (or some other class that gives you control over the text-content) to the uialertview?
No, I mean subclassing as in: creating a new class with the other class as the parent, and then overriding the appropriate methods as necessary to achieve what you are after: For example,
Code:
@interface MyAlertView: UIAlertView { }

- (void)drawRect:(CGRect)rect
{
     // custom drawing goes here
}
 

Danneman101

macrumors 6502
Original poster
Aug 14, 2008
361
1
Alright, that sounds like a good way to solve this. Thanks for your help, dejo - much appreciated :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.