Class

# iOSTabBar

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

An iOS TabBar.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                                       | Type                                   | Read-Only | Shared |
|------------------------------------------------------------|----------------------------------------|-----------|--------|
| `BackgroundColor<iostabbar.backgroundcolor>`               | `ColorGroup</api/graphics/colorgroup>` |           |        |
| `BadgeColor<iostabbar.badgecolor>`                         | `ColorGroup</api/graphics/colorgroup>` |           |        |
| `BadgeTextColor<iostabbar.badgetextcolor>`                 | `ColorGroup</api/graphics/colorgroup>` |           |        |
| `SelectedIndex<iostabbar.selectedindex>`                   | `Integer</api/data_types/integer>`     |           |        |
| `SelectedTabTextColor<iostabbar.selectedtabtextcolor>`     | `ColorGroup</api/graphics/colorgroup>` |           |        |
| `TabCount<iostabbar.tabcount>`                             | `Integer</api/data_types/integer>`     |           |        |
| `UnselectedTabTextColor<iostabbar.unselectedtabtextcolor>` | `ColorGroup</api/graphics/colorgroup>` |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                                   | Parameters                                                                                                              | Returns                                     | Shared |
|--------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|---------------------------------------------|--------|
| `AddTab<iostabbar.addtab>`                             | content As `iOSTabContent</api/ios/iostabcontent>`                                                                      |                                             |        |
| `BadgeAt<iostabbar.badgeat>`                           | index As `Integer</api/data_types/integer>`                                                                             | `String</api/data_types/string>`            |        |
|                                                        | index As `Integer</api/data_types/integer>`, `Assigns</api/language/assigns>` value As `String</api/data_types/string>` |                                             |        |
| `CaptionAt<iostabbar.captionat>`                       | index As `Integer</api/data_types/integer>`                                                                             | `String</api/data_types/string>`            |        |
|                                                        | index As `Integer</api/data_types/integer>`, `Assigns</api/language/assigns>` value As `String</api/data_types/string>` |                                             |        |
| `IconAt<iostabbar.iconat>`                             | index As `Integer</api/data_types/integer>`                                                                             | `Picture</api/graphics/picture>`            |        |
|                                                        | index As `Integer</api/data_types/integer>`, `Assigns</api/language/assigns>` image As `Picture</api/graphics/picture>` |                                             |        |
| `ViewControllerHandle<iostabbar.viewcontrollerhandle>` |                                                                                                                         | `Ptr</api/data_types/additional_types/ptr>` |        |

## Events

<div class="rst-class">

table-centered_column_4

</div>

| Name                                             | Parameters                                 | Returns |
|--------------------------------------------------|--------------------------------------------|---------|
| `AppearanceChanged<iostabbar.appearancechanged>` | dark As `Boolean</api/data_types/boolean>` |         |

## Property descriptions

<div id="iostabbar.backgroundcolor">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSTabBar.BackgroundColor

**BackgroundColor** As `ColorGroup</api/graphics/colorgroup>`

> The background color for the <span class="title-ref">iOSTabBar</span>.
>
> This code sets the value of the BackgroundColor property:
>
> ``` xojo
> Me.BackgroundColor = Color.AccentThemeColor
> ```

<div id="iostabbar.badgecolor">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSTabBar.BadgeColor

**BadgeColor** As `ColorGroup</api/graphics/colorgroup>`

> The badge color for the <span class="title-ref">iOSTabBar</span>.

<div id="iostabbar.badgetextcolor">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSTabBar.BadgeTextColor

**BadgeTextColor** As `ColorGroup</api/graphics/colorgroup>`

> The color for the text used in the badge(s) for the <span class="title-ref">iOSTabBar</span>.

<div id="iostabbar.selectedindex">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSTabBar.SelectedIndex

**SelectedIndex** As `Integer</api/data_types/integer>`

> Used to get or set the visible tab panel. The first item is zero.
>
> The following example changes the selected tab to the third item at the Screens Opening-Event:
>
> ``` xojo
> Self.ParentTabBar.SelectedIndex = 2
> ```

<div id="iostabbar.selectedtabtextcolor">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSTabBar.SelectedTabTextColor

**SelectedTabTextColor** As `ColorGroup</api/graphics/colorgroup>`

> The text color for the selected tab in the <span class="title-ref">iOSTabBar</span>.

<div id="iostabbar.tabcount">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSTabBar.TabCount

**TabCount** As `Integer</api/data_types/integer>`

> Used to get the number of tabs in the <span class="title-ref">iOSTabBar</span>.

<div id="iostabbar.unselectedtabtextcolor">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSTabBar.UnselectedTabTextColor

**UnselectedTabTextColor** As `ColorGroup</api/graphics/colorgroup>`

> The text color for the unselected tab(s) in the <span class="title-ref">iOSTabBar</span>.

## Method descriptions

<div id="iostabbar.addtab">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSTabBar.AddTab

**AddTab**(content As `iOSTabContent</api/ios/iostabcontent>`)

> Adds an iOSView to the tab bar.
>
> This code (on a View) add View3 to the TabBar:
>
> ``` xojo
> If Self.ParentTabBar <> Nil Then
>    Var v As New View3
>    Self.ParentTabBar.AddTab(v)
> End If
> ```

<div id="iostabbar.badgeat">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSTabBar.BadgeAt

**BadgeAt**(index As `Integer</api/data_types/integer>`) As `String</api/data_types/string>`

> Gets the badge on the tab at the *index* passed.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

**BadgeAt**(index As `Integer</api/data_types/integer>`, `Assigns</api/language/assigns>` value As `String</api/data_types/string>`)

> Sets the badge on the tab at the *index* passed. If the badge is set to an empty string, the badge is removed.

<div id="iostabbar.captionat">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSTabBar.CaptionAt

**CaptionAt**(index As `Integer</api/data_types/integer>`) As `String</api/data_types/string>`

> Gets the caption for the tab at the *index* passed.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

**CaptionAt**(index As `Integer</api/data_types/integer>`, `Assigns</api/language/assigns>` value As `String</api/data_types/string>`)

> Sets the caption for the tab at the *index* passed.

<div id="iostabbar.iconat">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSTabBar.IconAt

**IconAt**(index As `Integer</api/data_types/integer>`) As `Picture</api/graphics/picture>`

> Gets the `Picture</api/graphics/picture>` representing the icon for the tab at the *index* passed.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

**IconAt**(index As `Integer</api/data_types/integer>`, `Assigns</api/language/assigns>` image As `Picture</api/graphics/picture>`)

> Sets the icon for the tab at the *index* passed to the *image* passed.

<div id="iostabbar.viewcontrollerhandle">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSTabBar.ViewControllerHandle

**ViewControllerHandle** As `Ptr</api/data_types/additional_types/ptr>`

> The handle to use when creating `Declares</api/language/declare>` to the underlying OS object.
>
> On iOS, the underlying OS object is a UIViewController.

## Event descriptions

<div id="iostabbar.appearancechanged">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSTabBar.AppearanceChanged

**AppearanceChanged**(dark As `Boolean</api/data_types/boolean>`)

> Called when a user switches between Light and Dark mode.
>
> Use this event to update any graphics or other UI as needed.

## Notes

You set up a tab bar using the Inspector to change the Content property for an iOSLayout. Refer to Getting Started with iOS for information on how to do this. From the [Apple User Interface Guidelines](https://developer.apple.com/library/ios/documentation/userexperience/conceptual/mobilehig/Bars.html#//apple_ref/doc/uid/TP40006556-CH12-SW52), a tab bar:

- Is translucent
- Always appears at the bottom edge of the screen
- Displays no more than five tabs at one time in a horizontally compact environment (if there are more tabs, the tab bar displays four of them and adds the More tab, which reveals the additional tabs in a list)
- Maintains the same height in all orientations
- Can display a badge on a tab to communicate app-specific information (a badge is a red oval containing white text and either a number or exclamation point)

Regardless of the icon's visual style, create a tab bar icon in the following sizes: About 50 x 50 pixels (96 x 64 pixels maximum). Don't include text in a custom tab bar icon.

## Compatibility

|                       |        |
|-----------------------|--------|
| **Project Types**     | Mobile |
| **Operating Systems** | iOS    |

<div class="seealso">

`Object</api/data_types/additional_types/object>` parent class; `iOSLayout</api/ios/ioslayout>`, `MobileScreen</api/user_interface/mobile/mobilescreen>`, `iOSTabContent</api/ios/iostabcontent>`

</div>
