2012-02-23 29 views
0

在我的代碼中,實際上,字體大小應該改變,如果它的徘徊,但它沒有。爲什麼不? 因爲如果我懸停標籤,字體大小應該切換到20.有誰知道問題在哪裏?通常情況下,您應該期望字體在其懸停後調整大小,但不會調整大小。在actionscript中的移動應用程序上懸停狀態不起作用

<?xml version="1.0" encoding="utf-8"?> 
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
      xmlns:s="library://ns.adobe.com/flex/spark" applicationDPI="160"> 
<fx:Declarations> 
    <!-- Place non-visual elements (e.g., services, value objects) here --> 

    <s:ArrayList id="employeList"> 
     <fx:String>Mein Buch, was geht</fx:String> 
     <fx:String>Der Graf von Monte Christo</fx:String> 
     <fx:String>Hier steht das neu buche</fx:String> 
     <fx:String>hmmm</fx:String> 
    </s:ArrayList> 


    <s:ArrayList id="testList"> 
     <fx:Object test="try" test2="this"></fx:Object> 
     <fx:Object test="out" test2="plz"></fx:Object> 
    </s:ArrayList> 
</fx:Declarations> 



<s:DataGroup dataProvider="{(testList)}" > 
    <s:layout> 
     <s:VerticalLayout> 

     </s:VerticalLayout> 
     </s:layout> 

    <s:itemRenderer> 
     <fx:Component> 
      <s:ItemRenderer> 
       <s:states> 
        <s:State name="normal"> 

        </s:State> 

        <s:State name="hovered" > 

        </s:State> 

        <s:State name="selected" > 

        </s:State> 
       </s:states> 
       <s:BorderContainer> 
        <s:layout > 
       <s:HorizontalLayout   
        horizontalAlign="center" paddingBottom="80"> 

         </s:HorizontalLayout> 
        </s:layout> 
        <s:Label text="{data.test} {data.test2}" 

            fontSize.hovered="20" fontSize.selected="30"> 

        </s:Label> 

        <s:CheckBox> 

        </s:CheckBox> 

       </s:BorderContainer> 

      </s:ItemRenderer> 

     </fx:Component> 
    </s:itemRenderer> 
</s:DataGroup> 
</s:Application> 
+0

我不認爲移動設備具有「懸停」狀態。你可能更願意使用你的等價物MOUSE_DOWN – scriptocalypse 2012-02-23 20:58:29

+0

如果你使用鼠標,你會用鼠標取消選擇嗎?如果你沒有專注於特定的標籤,你會用鼠標繼續下去? – user938044 2012-02-23 22:32:26

回答

0

在你的代碼,你寫

< S:標籤 文本= 「{data.test} {} data.test2」 fontSize.hovered = 「20」 fontSize.selected =「30 「>

指定的字體是做什麼用的徘徊選擇狀態,但是你沒有指定的字體是做什麼用的正常狀態。

由於在上面的代碼中沒有指定字體爲正常狀態,所以可能不是正常狀態下的字體與懸停狀態下的字體之間的明顯區別。

我建議你加入另一個參數啓動:

fontSize="10" 

將應用於其他fontSize的時候。 狀態參數不適用。