Legacy Customizations

Customize appearance information directly on the navigation bar object.

Overview

In iOS 13 and later, customize your navigation bar using the standardAppearance, compactAppearance, and scrollEdgeAppearance properties. You may continue to use these legacy accessors to customize your navigation bar's appearance directly, but you must update the appearance for different bar configurations yourself.

Topics

Configuring the Navigation Bar

Customizing Your App’s Navigation Bar

Create custom titles, prompts, and buttons in your app’s navigation bar.

Setting the Bar's Style

barStyle

The navigation bar style that specifies its appearance.

UIBarStyle

Defines the stylistic appearance of different types of views.

Configuring the Title

titleTextAttributes

Display attributes for the bar’s title text.

largeTitleTextAttributes

Display attributes for the bar's large title text.

- titleVerticalPositionAdjustmentForBarMetrics:

Returns the title’s vertical position adjustment for given bar metrics.

- setTitleVerticalPositionAdjustment:forBarMetrics:

Sets the title’s vertical position adjustment for given bar metrics.

Configuring Bar Button Items

tintColor

The tint color to apply to the navigation items and bar button items.

Configuring the Back Button

backIndicatorImage

The image shown beside the back button.

backIndicatorTransitionMaskImage

The image used as a mask for content during push and pop transitions.

Changing the Background

barTintColor

The tint color to apply to the navigation bar background.

- backgroundImageForBarMetrics:

Returns the background image for given bar metrics.

- setBackgroundImage:forBarMetrics:

Sets the background image for given bar metrics.

- backgroundImageForBarPosition:barMetrics:

Returns the background image to use for a given bar position and set of metrics.

- setBackgroundImage:forBarPosition:barMetrics:

Sets the background image to use for a given bar position and set of metrics.

Adding a Shadow

shadowImage

The shadow image to be used for the navigation bar.

See Also

Customizing the Bar's Appearance

prefersLargeTitles

A Boolean value indicating whether the title should be displayed in a large format.

standardAppearance

The appearance settings for a standard-height navigation bar.

compactAppearance

The appearance settings for a compact-height navigation bar.

scrollEdgeAppearance

The appearance settings to use when the edge of any scrollable content reaches the matching edge of the navigation bar.

translucent

A Boolean value indicating whether the navigation bar is translucent (YES) or not (NO).