Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

popViewController forces navigationbar title to align left

Tags:

ios

iphone

I am experiencing a weird glitch where a normal titleview on a viewcontroller suddenly aligns left when popViewControllerAnimated: is called. Does anyone seem to be experiencing a similar issue?

like image 736
chourobin Avatar asked Aug 23 '26 06:08

chourobin


1 Answers

I tried to pinpoint the issue and it occurs when I have this set:

[[UIBarButtonItem appearance] setBackgroundVerticalPositionAdjustment:1.0f forBarMetrics:UIBarMetricsDefault];

After removing this line, the titleview doesn't glitch or align left when popping the view controller. I would also like to note that I have a custom background image for the barbuttonitem. This is the first time I've ever experienced such an issue, hope it helps someone.

like image 171
chourobin Avatar answered Aug 26 '26 02:08

chourobin