【问题标题】:Flex mobile Turning tabBar visible = True/False?Flex 移动 转动 tabBar 可见 = True/False?
【发布时间】:2011-08-31 20:26:32
【问题描述】:

我尝试使用以下代码切换 tabBarvisible = true/false:

    protected function textArea_clickHandler(event:MouseEvent):void
        {
            if (tabBarVisible="true")   {
                tabBarVisible="false";
            }
            else if (tabBarVisible="false") {
                tabBarVisible="true";   } 
        }

但只能得到 tabBarvisible="true" 并且当我再次单击时没有任何反应。 tabBarvisible 不会变成“假”。我的代码有问题吗?

谢谢。

【问题讨论】:

    标签: apache-flex flex4 flash-builder flex4.5


    【解决方案1】:

    是的,您只使用了一个“=”符号,以便实际分配值而不是比较它。此外,您不需要为布尔值使用引号。

    tabBarVisible == true
    

    另外,由于您总是切换值,您可以通过简单地反转值来简化代码

    protected function textArea_clickHandler(event:MouseEvent):void
    {
        tabBarVisible = !tabBarVisible;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-06-09
      • 1970-01-01
      • 2011-12-18
      • 1970-01-01
      • 1970-01-01
      • 2021-06-26
      • 1970-01-01
      相关资源
      最近更新 更多