java.lang.Object | |||
↳ | com.neomades.ui.View | ||
↳ | com.neomades.ui.Layout | ||
↳ | com.neomades.ui.TabLayout |
A TabLayout
represents a layout with many tabs.
Cross-Platform rendering
In iOS, a SegmentedView
is displayed at the top of the
layout in order to switch between tabs.
In Android, a TabBar
is displayed at the top of the
layout.
XML Attributes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Attribute Name | Related Method | Description | |||||||||
currentTab | setCurrentTab(int) | The selected tab |
[Expand]
Inherited XML Attributes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | STYLE_BAR | The iOS small toolbar style for segmented controls. | |||||||||
int | STYLE_BEZELED | The iOS large bezeled style for segmented controls. | |||||||||
int | STYLE_BORDERED | The iOS large bordered style for segmented controls. | |||||||||
int | STYLE_PLAIN | The iOS large plain style for segmented controls. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
TabLayout()
Constructs an empty tab layout, with no tab.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
addTab(String txt, Image img, View content)
Add a tab to this tab layout
| ||||||||||
void |
addTab(String txt, View content)
Add a tab to this tab layout
| ||||||||||
void |
addTab(int txtId, int imgId, View content)
Add a tab to this tab layout
| ||||||||||
void |
addTab(Image img, View content)
Add a tab to this tab layout
| ||||||||||
int |
getCurrentTab()
Get the current selected tab.
| ||||||||||
void |
setCurrentTab(int number)
Changes the current selected tab
| ||||||||||
void |
setStyle(int style)
Sets the style of the segmented view for tabs in iOS.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
The iOS small toolbar style for segmented controls. Segmented controls in this style can have a tint color.
The iOS large bezeled style for segmented controls. Segmented controls in this style can have a tint color
The iOS large bordered style for segmented controls.
The iOS large plain style for segmented controls. This style is the default.
Constructs an empty tab layout, with no tab.
Add a tab to this tab layout
txt | The title of the tab |
---|---|
img | The image of the tab, that will be displayed near the title |
content | The content of the tab |
CrossThreadException | if the method is called from outside the UI-Thread |
---|---|
IllegalStateException | if the layout has already a parent |
Add a tab to this tab layout
txt | The title of the tab |
---|---|
content | The content of the tab |
CrossThreadException | if the method is called from outside the UI-Thread |
---|---|
IllegalStateException | if the layout has already a parent |
Add a tab to this tab layout
txtId | the string id of the tab's title |
---|---|
imgId | the image id of the tab |
content | The content of the tab |
CrossThreadException | if the method is called from outside the UI-Thread |
---|---|
IllegalStateException | if the layout has already a parent |
Add a tab to this tab layout
img | The image of the tab, that will be displayed instead of the title |
---|---|
content | The content of the tab |
CrossThreadException | if the method is called from outside the UI-Thread |
---|---|
IllegalStateException | if the layout has already a parent |
Get the current selected tab.
Changes the current selected tab
number | current tab index |
---|
CrossThreadException | if the method is called from outside the UI-Thread |
---|
Sets the style of the segmented view for tabs in iOS.
style | one of STYLE_BAR, STYLE_BEZELED, STYLE_BORDERED or STYLE_PLAIN |
---|