Tony
Tony

Reputation: 19151

How do I set the height of a toolbar in objective C?

I have this code in my applicationDidFinishLaunching:

navController.toolbarHidden = NO;
[navController toolbar].tintColor = [UIColor darkGrayColor];
[[navController toolbar] setFrame:CGRectMake(0.0,0.0,320.0,180.0)];

The first two lines definitely have an effect on the UI. For example, if I set toolbarHidden to YES, it is certainly hidden. However, when I try to set the frame and customize the toolbar height, no change takes place. Does anyone know how to fix this?

Upvotes: 3

Views: 2541

Answers (3)

Bittu
Bittu

Reputation: 676

if you were to create your own toolbar, you can just use the frame property of the toolbar to create it. UINavigationController's toolbar height is not adjustable.

Upvotes: 0

Alex Reynolds
Alex Reynolds

Reputation: 96937

You have to make your own toolbar class if you need one with an adjustable height.

Upvotes: 1

Alex
Alex

Reputation: 26859

UIToolbars have a fixed height. You won't be able to change it.

Upvotes: 5

Related Questions