java.lang.Object | ||
↳ | com.neomades.app.Screen | |
↳ | com.neomades.app.TabScreen |
The TabScreen
class implements a specialized screen
that
manages a tab-style selection interface.
In iOS, this screen interface displays tabs
at the
bottom of the window for selecting between the different modes and for
displaying the views for that mode. If there is more than 5 tab item, then
iOS will show a "More" tab item in order to show additional tab items into a
separate list.
In Android, this screen interface displays tabs
at the
top of the window for selecting between the different modes and for
displaying the views for that mode.
In iOS and Android, each tab keeps a sub-navigation stack. To access to the
stack of the TabScreen
and replace or pop the TabScreen
, use
getRootController()
on a controller instance.
For other platforms, if a tab content will push a screen, then the
TabScreen
will be saved into the stack, and the new screen will be
displayed. To go back to the TabScreen
, the user will click over Back
button.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
TabScreen() |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
addTab(int txtId, int imgId, Class screen)
Add a tab to this TabScreen.
| ||||||||||
void |
addTab(int txtId, int imgId, Class screen, ScreenParams parameters)
Adds a tab to this TabScreen.
| ||||||||||
void |
addTab(TabSpec tabSpec)
Add a tab to this TabScreen.
| ||||||||||
int |
getCurrentTab()
Get the current selected tab.
| ||||||||||
void |
setCurrentTab(int number)
Changes the current selected tab.
| ||||||||||
void |
setCustomTabBar(CustomTabBar customTabBar)
Sets a customized
TabBar . | ||||||||||
void |
setPagerEnabled(boolean enabled)
Enables or disables the pager mode in order to allow the user to flip left
and right through
tabs . | ||||||||||
void | setTabBarPosition(int anchor) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Add a tab to this TabScreen. The text and the image will be used to complete
the TabBar
item associated with the tab.
For further customization of Tab, see addTab(TabSpec)
and
TabSpec
.
txtId | the string id of the tab's title |
---|---|
imgId | the image id of the tab |
screen | the content screen of the tab |
Adds a tab to this TabScreen. The text and the image will be used to complete
the TabBar
item associated with the tab. Additional information
can be passed to the screen using ScreenParams
.
For further customization of Tab, see addTab(TabSpec)
and
TabSpec
.
txtId | the string id of the tab's title |
---|---|
imgId | the image id of the tab |
screen | the content screen of the tab |
parameters | additional information given to the pushed screen |
Get the current selected tab.
Changes the current selected tab.
number | current tab index |
---|
Sets a customized TabBar
.
customTabBar | the customized TabBar or null to set the
native TabBar |
---|
IllegalStateException | if setCustomTabBar(CustomTabBar) is called after
addTab() |
---|
Enables or disables the pager mode in order to allow the user to flip left
and right through tabs
.
Only for Android. By default disabled.
enabled | true to enable |
---|
IllegalStateException | if setPagerEnabled(boolean) is called after
addTab()
|
---|