【问题标题】:Is there a way to only select between month and year on Flex 4.7 DateSpinner有没有办法只在 Flex 4.7 DateSpinner 上选择月份和年份
【发布时间】:2014-05-12 07:50:55
【问题描述】:

我想只允许在我的 DateSpinner 上选择月份和年份。这在 Flex SDK 4.7 中可行吗? 谢谢

【问题讨论】:

    标签: actionscript-3 apache-flex mobile flex4.5 flex4.7


    【解决方案1】:

    这不是您可以启用/禁用的设置。

    一种方法是将 SpinnerList 与您想要的年份值一起使用。

    但您也可以扩展 DateSpinner 并隐藏您不想看到的组件。 如果您查看 DateSpinner 源代码,您会看到三个属性:

      /**
        *  The SpinnerList that shows the year field of the date.
        */
       protected var yearList:SpinnerList;
    
       /**
        *  The SpinnerList that shows the month field of the date.
        */
       protected var monthList:SpinnerList;
    
       /**
        *  The SpinnerList that shows the date field of the date.
        */
       protected var dateList:SpinnerList;
    

    微调器初始化后,您可以将其可见性和 includeinlayout 设置为 false。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-02-23
      • 2010-12-25
      • 2021-12-15
      • 2020-09-06
      • 1970-01-01
      • 1970-01-01
      • 2013-06-07
      • 1970-01-01
      相关资源
      最近更新 更多