2017-03-02 73 views

回答

0

我找到了一個簡單的解決方案,我不必使用皮膚結構來聲明狀態。我甚至沒有聲明擴展WindowedApplication的ApplicationClass中的狀態。 解決方法是:只聲明Main.MXML中的狀態,並且用正確的名稱空間來聲明所有的狀態,在我的情況下它應該是「custom」。 這裏是Main.MXML:

<?xml version="1.0" encoding="utf-8"?> 
<custom:ApplicationClass xmlns:fx="http://ns.adobe.com/mxml/2009" 
         xmlns:s="library://ns.adobe.com/flex/spark" 
         xmlns:mx="library://ns.adobe.com/flex/mx" 
         xmlns:custom="components.*"> 
    <custom:states> 
     <s:State name="loginState"/> 
     <s:State name="infoState"/> 
    </custom:states> 

    <s:Panel id="loginPanel" title="Login" includeIn="loginState" /> 

</custom:ApplicationClass> 

我只想不同小組之間變化,所以這種方法很適合我。當然還有其他一些情況,在這些情況下需要在剝皮時聲明這些州。 我已經從此鏈接獲得此解決方案:Error: Could not resolve to a component implementation.