Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Kevin Walker
Kevin Walker
2,354 Points

iOS Back Button Position

I have a custom back button in my app in the Navigation Bar and for the life of me, cannot figure out why it is being pushed up. It is in normal position in iOS 11.0 and up, but anything below, the image is pushed slightly up vertically. It is touching the bottom of the status bar.

Has anyone else encountered this?

Here is my code in the App Delegate file:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

let navigationBarAppearace = UINavigationBar.appearance() UINavigationBar.appearance().backIndicatorImage = UIImage(named: "backButton") UINavigationBar.appearance().backIndicatorTransitionMaskImage = UIImage(named: "backButton") UIBarButtonItem.appearance().setBackButtonTitlePositionAdjustment(UIOffset(horizontal: 5.0, vertical: -60.0), for: .default)

}