Actionscript 中移动应用程序的悬停状态不起作用
在我的代码中,实际上字体大小应该改变,如果它悬停但没有。为什么不呢? 因为如果我将鼠标悬停在标签上,字体大小应该切换到 20。有谁知道问题出在哪里?通常,您应该期望字体在悬停后会调整大小,但它不会调整大小。
<?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>
In my Code, actually the fontsize should change, if its hovered but it doesnt. Why not?
Because if i hover the the Label, the fontsize should switch to 20. Does anyone know where the problem is? Normally you should expect the font to be resized after its hovered, but it doesnt resize.
<?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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的代码中,您编写
它指定悬停和选择状态的字体,但是您不指定正常状态的字体。
由于上面的代码中没有指定正常状态下的字体是什么,所以正常状态下的字体与悬停状态下的字体之间可能没有明显的区别。
我建议您首先添加另一个参数:
当其他 fontSize.state 参数不适用时,该参数将适用。
In your code, you write
<s:Label
text="{data.test} {data.test2}"
fontSize.hovered="20" fontSize.selected="30">
which specifies what the font is for the hovered and select state, however you do not specify what the font is for the normal state.
Since it is not specified in the above code what the font is for the normal state, there may not be an obvious difference between the font in the normal state vs. the font in the hovered state.
I suggest you start by adding another parameter:
That will apply when the other fontSize.state parameters do not apply.