Legacy Customizations

Customize appearance information directly on the tab bar object.

Overview

In iOS 13 and later, customize your tab bar using the standardAppearance property. You may also continue to use these legacy accessors to customize your tab bar's appearance directly.

Topics

Setting the Bar's Style

var barStyle: UIBarStyle

The tab bar style that specifies its appearance.

enum UIBarStyle

Defines the stylistic appearance of different types of views.

Configuring Tab Bar Items

var tintColor: UIColor!

The tint color to apply to the tab bar items.

Customizing Item Spacing

var itemPositioning: UITabBar.ItemPositioning

The positioning scheme for the tab bar items in the tab bar.

enum UITabBar.ItemPositioning

Constants that specify tab bar item positioning.

var itemSpacing: CGFloat

The amount of space (in points) to use between tab bar items.

var itemWidth: CGFloat

The width (in points) of tab bar items.

Configuring Selection Appearance

var unselectedItemTintColor: UIColor?

The tint color to apply to unselected tabs.

var selectionIndicatorImage: UIImage?

The image to use for the selection indicator.

var selectedImageTintColor: UIColor?

The tint color applied to the selected tab bar item.

Deprecated

Changing the Background

var barTintColor: UIColor?

The tint color to apply to the tab bar background.

var backgroundImage: UIImage?

The custom background image for the tab bar.

Adding a Shadow

var shadowImage: UIImage?

The shadow image to use for the tab bar.

See Also

Customizing Tab Bar Appearance

var standardAppearance: UITabBarAppearance

The appearance settings for a standard-height tab bar.

var leadingAccessoryView: UIView

The view at the leading edge of a tab bar on tvOS.

var trailingAccessoryView: UIView

The view at the trailing edge of a tab bar on tvOS.

var isTranslucent: Bool

A Boolean value that indicates whether the tab bar is translucent.