java.lang.Object | |
↳ | com.neomades.app.CustomTabBar |
Create a custom TabBar
to replace the default system
TabBar
in TabScreen
.
This class is useful to change the look and fill of a TabBar
and
of its items (background, title, font...).
Note that only one kind of background can be defined at the same time (color,
image or background) for the TabBar
or for a selected item.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CustomTabBar() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
setBackground(int resBackgroundid)
Set a
Background as background of the TabBar . | ||||||||||
void |
setBackground(Background background)
Set a
Background as background of the TabBar . | ||||||||||
void |
setBackgroundColor(Color color)
Set a uniform color as background of the
TabBar . | ||||||||||
void |
setBackgroundImage(int resImageId)
Set an image as the
TabBar background. | ||||||||||
void |
setBackgroundImage(Image image)
Set an image as background of the
TabBar . | ||||||||||
void |
setItemMoreImage(Image moreImage)
Registers the image to display in the
More tab. | ||||||||||
void |
setItemMoreText(String moreText)
Registers the text to display in the
More tab. | ||||||||||
void |
setItemsFont(Font font)
The font of the tab item titles.
| ||||||||||
void |
setItemsTextColor(Color textColor)
The color of the tab item titles.
| ||||||||||
void |
setSelectedItemBackground(int backgroundResId)
The
Background of a TabBar item when selected. | ||||||||||
void |
setSelectedItemBackground(Background background)
The
Background of a TabBar item when selected. | ||||||||||
void |
setSelectedItemBackgroundColor(Color color)
The background color of a
TabBar item when selected. | ||||||||||
void |
setSelectedItemBackgroundImage(Image image)
The background image of a
TabBar item when selected. | ||||||||||
void |
setSelectedItemBackgroundImage(int imageResId)
The background image of a
TabBar item when selected. | ||||||||||
void |
setSelectedItemFont(Font font)
The font of the tab item title when selected
| ||||||||||
void |
setSelectedItemTextColor(Color color)
The color of the tab item title when selected.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Set a Background
as background of the TabBar
.
resBackgroundid | the id of the background of the TabBar |
---|
Set a Background
as background of the TabBar
.
background | the background of the TabBar |
---|
Set a uniform color as background of the TabBar
.
color | the background color of the TabBar |
---|
Set an image as the TabBar
background. If the image does not
have the size of the TabBar
, it will be repeated along the
TabBar
width and height.
resImageId | the id of the background image of the TabBar |
---|
Set an image as background of the TabBar
. If the image does not
have the size of the TabBar
, it will be repeated along the
TabBar
width and height.
image | the background image of the TabBar |
---|
Registers the image to display in the More
tab.
moreImage | the image to be displayed |
---|
Registers the text to display in the More
tab.
moreText | the text to display |
---|
The color of the tab item titles.
textColor | the color of the tab item titles. |
---|
The Background
of a TabBar
item when selected. The
Background
will be applied around the item that is selected in the
TabBar
.
backgroundResId | the id of the background of a selected item. |
---|
The Background
of a TabBar
item when selected. The
Background
will be applied around the item that is selected in the
TabBar
.
background | the background of a selected item. |
---|
The background color of a TabBar
item when selected. The color
will be applied around the item that is selected in the TabBar
.
Note that the color is defined for all the items in the TabBar
.
color | the background color of a selected item. |
---|
The background image of a TabBar
item when selected. The image
will be applied around the item that is selected in the TabBar
.
If the image does not have the size of the tab item, it will be stretched to
take all the space of the item. If a selected background image was already
defined for a specific tab using
setSelectedBackgroundImage(Image)
, the image set with this
method of CustomTabBar
will be ignored for this tab.
image | the background image of a selected item. |
---|
The background image of a TabBar
item when selected. The image
will be applied around the item that is selected in the TabBar
.
If the image does not have the size of the tab item, it will be stretched to
take all the space of the item. If a selected background image was already
defined for a specific tab using
setSelectedBackgroundImage(Image)
, the image set with this
method of CustomTabBar
will be ignored for this tab.
imageResId | the id of the background image of a selected item. |
---|
The font of the tab item title when selected
font | the font of the tab item title when selected |
---|
The color of the tab item title when selected.
color | the color of the tab item title when selected. |
---|