Instance Property

isTranslucent

A Boolean value indicating whether the navigation bar is translucent (true) or not (false).

Declaration

var isTranslucent: Bool { get set }

Discussion

The default value is true. If the navigation bar has a custom background image, the default is true if any pixel of the image has an alpha value of less than 1.0, and false otherwise.

If you set this property to true on a navigation bar with an opaque custom background image, the navigation bar applies a system-defined opacity of less than 1.0 to the image.

If you set this property to false on a navigation bar with a translucent custom background image, the navigation bar provides an opaque background for the image using black if the navigation bar has UIBarStyle.black style, white if the navigation bar has UIBarStyle.default, or the navigation bar’s barTintColor if a custom value is defined.

See Also

Customizing the Bar Appearance

Customizing Your App’s Navigation Bar

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

var backIndicatorImage: UIImage?

The image shown beside the back button.

var backIndicatorTransitionMaskImage: UIImage?

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

var barStyle: UIBarStyle

The navigation bar style that specifies its appearance.

var barTintColor: UIColor?

The tint color to apply to the navigation bar background.

var shadowImage: UIImage?

The shadow image to be used for the navigation bar.

var tintColor: UIColor!

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

func backgroundImage(for: UIBarMetrics) -> UIImage?

Returns the background image for given bar metrics.

func setBackgroundImage(UIImage?, for: UIBarMetrics)

Sets the background image for given bar metrics.

func backgroundImage(for: UIBarPosition, barMetrics: UIBarMetrics) -> UIImage?

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

func setBackgroundImage(UIImage?, for: UIBarPosition, barMetrics: UIBarMetrics)

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