Actionscript 中移动应用程序的悬停状态不起作用

发布于 2025-01-08 19:55:40 字数 2315 浏览 0 评论 0原文

在我的代码中,实际上字体大小应该改变,如果它悬停但没有。为什么不呢? 因为如果我将鼠标悬停在标签上,字体大小应该切换到 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

时光与爱终年不遇 2025-01-15 19:55:41

在您的代码中,您编写

它指定悬停选择状态的字体,但是您不指定正常状态的字体。

由于上面的代码中没有指定正常状态下的字体是什么,所以正常状态下的字体与悬停状态下的字体之间可能没有明显的区别。

我建议您首先添加另一个参数:

  fontSize="10"

当其他 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:

  fontSize="10"

That will apply when the other fontSize.state parameters do not apply.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文