Hi! My client can't read iPhone's deafault fonts, the size is too small. I have an application with a navigation bar and I need to make everything in it bigger, for example, the font's size.
IB doesn't seem to allow this... any help?
Many thanks!
Hi! My client can't read iPhone's deafault fonts, the size is too small. I have an application with a navigation bar and I need to make everything in it bigger, for example, the font's size.
IB doesn't seem to allow this... any help?
Many thanks!
This is generally impossible.
What's more, I believe making the navigation bar taller is a violation of Apple Human Interface Guidelines, and your application may be rejected from the App Store because of it. Please make sure your client understands this risk before proceeding.
(Pointing out rejection risks is usually a good way to convince clients against making nonsense decisions.)
If you decided to just change the font size in the navigation bar, you can do this (usually in your UIViewController
's viewDidLoad
method):
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectZero];
[titleLabel setBackgroundColor:[UIColor clearColor]];
// here's where you can customize the font size
[titleLabel setFont:[UIFont boldSystemFontOfSize:18.0]];
[titleLabel setTextColor:[UIColor whiteColor]];
[titleLabel setText:self.title];
[titleLabel sizeToFit];
[titleLabel setCenter:[self.navigationItem.titleView center]];
[self.navigationItem setTitleView:titleLabel];
[titleLabel release];