Using UIAppearance to move UINavigationBar
Asked Answered
D

1

7

I am trying to increase the height of the UINavigationBar via UIAppearance

The height itself does change but part of the bar is obscured by the device status bar. I would like to move the bar down 22 pixels so it is fully visible:

[[UINavigationBar appearance] setFrame:CGRectMake([[UINavigationBar appearance] frame].origin.x, 22, [[UINavigationBar appearance] frame].size.width, 103)];

And I also set the autoresizing mask

[[UINavigationBar appearance] setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleBottomMargin];

But the bar is not translated. Is there another way or another step here?

Divisionism answered 6/6, 2012 at 16:48 Comment(0)
T
6

You can move down only title by this:

[[UINavigationBar appearance] setTitleVerticalPositionAdjustment:5 forBarMetrics:UIBarMetricsDefault];
Trstram answered 20/7, 2012 at 23:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.