TabNavigator自定义Tab

通过自定义TabNavigator 样式 tabStyleName 来改变Tab的外观。

样式的SCC代码:

 

.myTab

{

up-skin:ClassReference("skins.TabNavigatorTabSkin");

down-skin:ClassReference("skins.TabNavigatorTabSkin");

over-skin:ClassReference("skins.TabNavigatorTabSkin");

disabled-skin:ClassReference("skins.TabNavigatorTabSkin");

selected-up-skin:ClassReference("skins.TabNavigatorTabSelectedSkin");

selected-down-skin:ClassReference("skins.TabNavigatorTabSelectedSkin");

selected-over-skin:ClassReference("skins.TabNavigatorTabSelectedSkin");

selected-disabled-skin:ClassReference("skins.TabNavigatorTabSelectedSkin");

}

 

其中的TabNavigatorTabSkin和TabNavigatorTabSelectedSkin为两个自定义的皮肤,可以定义如下:

1.TabNavigatorTabSkin

 

minWidth="21" minHeight="21">

ratio="0.0"

alpha="0.12"/>

ratio="0.48"

alpha="0.12" />

ratio="0.48001"

alpha="0" />

2.TabNavigatorTabSelectedSkin:
minWidth="21" minHeight="21">
color="0xd3f0fe"
alpha="1" />
color="0x67c4ed" 
alpha="1" />
ratio="0.0"
alpha="0.12"/>
ratio="0.48"
alpha="0.12" />
ratio="0.48001"
alpha="0" />

你可能感兴趣的:(TabNavigator自定义Tab)