默认情况下,ViewNavigator的ActionBar位于顶部。我想要在底部移动。
navigator.actionbar.y = 415 //在底部获取动作栏
但在下一个视图中它又回到了顶部。您可以在每个视图中设置高度,但在返回底部之前,它会在顶部显示几秒钟。
答案 0 :(得分:2)
您希望为View Navigator设置外观以将Action Bar放在底部。
在主应用中,您可以添加样式:
<fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
s|ViewNavigator {
skinClass: ClassReference("CustomViewNavigatorSkin")
}
</fx:Style>
然后,创建您的CustomViewNavigatorSkin
课程:
<?xml version="1.0" encoding="utf-8"?>
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark">
<!-- host component -->
<fx:Metadata>
[HostComponent("spark.components.ViewNavigator")]
</fx:Metadata>
<!-- states -->
<s:states>
<s:State name="landscapeAndOverlay" />
<s:State name="portraitAndOverlay" />
<s:State name="landscape" />
<s:State name="portrait" />
<s:State name="disabled" />
<s:State name="normal" />
</s:states>
<s:VGroup width="100%" height="100%">
<s:VGroup id="contentGroup" height="100%" width="100%" />
<s:ActionBar id="actionBar" width="100%" />
</s:VGroup>
</s:Skin>