Skip to content

Tab Layout

Category Requires Version
Layout > Navigation API 21, Android 5.0 Lollipop 1

Overview

A visible component that groups other layout components such that only one of its children is shown at a time. Each of the child layouts can be accessed either by swiping left and right, or using the tabs at the top.

Events

Tab Item Selected

The event returns the name or the position of the selected tab.

Params
tab Text
position Number

Methods

Add New Tab

Add a new tab to the tab layout. If you don't want a icon then let it empty.

Params
name Text
icon Text

Add New Tab At

Add a new tab to the tab layout at the given position. If you don't want a icon then let it empty.

Params
name Text
icon Text
position Number

Count Tabs

Returns: Number

Returns the number of current added tab's.

Remove All Tabs

Remove all tab's from tab layout.

Remove Tab At

Removes a before added tab. If you want to delete the first tab then use as position '1'.

Params
position Number

Properties

Get Current Tab

Number ➖ Read - Blocks

Get the current selected tab.

Select Tab

Number ➖ Write - Blocks

Select a tab which is then the active tab.

Tabs Active Text Color

Color Default: #FF4081FF  ➖ Read Write - Designer Blocks

Specifies the tab's text color for active tab's.

Tabs Background Color

Color Default: #3F51B5FF  ➖ Read Write - Designer Blocks

Specifies the tab's background color.

Tabs Indicator Color

Color Default: #FFFFFFFF  ➖ Read Write - Designer Blocks

Specifies the tab's indicator color.

Tabs Mode

Number Default: 1 ➖ Read Write - Designer Blocks

Choose the mode used for the tab's. If no mode is specified, 'Scrollable' is taken as 'Default'. Use '0' for scrollable and '1' for fixed.

Tabs Text Color

Color Default: #FFFFFFFF  ➖ Read Write - Designer Blocks

Specifies the tab's text color for not selected tab's.

Visible

Boolean Default: True ➖ Read Write - Designer Blocks

Specifies whether the component should be visible on the screen. Value is true if the component is showing and false if hidden.

Width

Number ➖ Read Write - Blocks

Specifies the component's horizontal width, measured in pixels.

Width Percent

Number ➖ Write - Blocks

Specifies the component's horizontal width as a percentageof the Width of its parent Component.


Last update: November 9, 2022