0
我下個等級:自動調整的Spark NavigatorContent
<s:TabBar dataProvider="{stack}" />
<mx:ViewStack id="stack" width="100%">
<s:NavigatorContent width="100%" label="123" backgroundColor="#c02c31" >
<s:BorderContainer minHeight="200">
<s:List id="testList" width="100%" contentBackgroundColor="#f00fff" contentBackgroundAlpha="0"/>
</s:BorderContainer>
</s:NavigatorContent>
</mx:ViewStack>
而且我要實現未來:當testList.dataProvider
已經改變,列表改變其大小,NavigatorContent也改變它的大小。但是現在NavigatorContent並沒有改變它的大小取決於它的孩子。我做錯了什麼?
我寫代碼來測試它:
private var _testDP1:Array = ["aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg"];
private var _testDP2:Array = ["aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg"];
private var _someFlag:Boolean = false;
private function onClick(event:MouseEvent):void
{
if (!_someFlag)
{
testList.dataProvider = new ArrayList(_testDP1);
_someFlag = true;
} else
{
testList.dataProvider = new ArrayList(_testDP2);
_someFlag = false;
}
}
而且它現在的樣子。 啓動時:http://gyazo.com/65755dbd66346a49455344a767098b27
隨着_testDP1:http://gyazo.com/007a76d03cc8c9c88c75439446e01102
隨着_testDP2:http://gyazo.com/7dfccf00b7c39f6eb1cdac96298893d1
UPD:
我檢查與另一名家長(但具有相同的皮膚):SkinnableContainer
。它工作正常。所以NavigatorContent或ViewStack有問題。