[英]Using Date Spinner in flex mobile application
I am unable to use DateSpinner component in my flex mobile application. 我无法在我的Flex移动应用程序中使用DateSpinner组件。 I am only interest to print date but not time.
我只想打印日期,而不是时间。 How can I achieve this in my flex mobile project.
如何在我的Flex移动项目中实现这一目标。 Platform is Flash Builder 4.6.
平台是Flash Builder 4.6。
<s:HGroup verticalAlign="middle">
<s:SpinnerListContainer>
<s:DateSpinner id="dt" />
</s:SpinnerListContainer>
</s:HGroup>
The above code gives following error. 上面的代码给出以下错误。 TypeError: Error #1009: Cannot access a property or method of a null object reference.
TypeError:错误#1009:无法访问空对象引用的属性或方法。 DateSpinner.as:1290
DateSpinner.as:1290
In the example code for the DateSpinner
control, they are not wrapping it in a SpinnerListContainer
. 在
DateSpinner
控件的示例代码中,他们没有将其包装在SpinnerListContainer
。 So perhaps that's your problem. 所以也许这就是您的问题。 Have you tried the
DateSpinner
by itself? 您是否尝试过
DateSpinner
本身?
It appears to me that the SpinnerListContainer
is intended to be used with a SpinnerList
control. 在我看来,
SpinnerListContainer
旨在与SpinnerList
控件一起使用。 And that SpinnerList
is for more generic lists, while DateSpinner
is a stand alone component used specifically for dates/times. SpinnerList
用于更通用的列表,而DateSpinner
是专门用于日期/时间的独立组件。
The given code doesn't work when displayMode property is set to "date" only. 仅当displayMode属性设置为“ date”时,给定的代码不起作用。
<s:DateSpinner id="ds"
selectedDate="{new Date(2010, 11, 15)}"
minDate="{new Date(2000, 0, 1)}"
maxDate="{new Date(2200, 11, 31)}"
minuteStepSize="5" displayMode="date" />
when I use <s:DateSpinner id="dt" displayMode="dateAndTime" />
its works fine but it do not works when I set displayMode="date"
当我使用
<s:DateSpinner id="dt" displayMode="dateAndTime" />
它的效果很好,但是当我设置displayMode="date"
时,它不起作用
even the simplest form to dataspinner gives error, like you use 甚至dataspinner的最简单形式也会产生错误,就像您使用
<s:DateSpinner id="ds" />
i've the same problem. 我有同样的问题。 After debugging the as-code i found a problem with determine the textsize.
在调试as-code后,我发现确定textsize时出现问题。 So i look at my console output i found this warning: This component requires that the embedded font be declared with embedAsCFF= false .
因此,我在控制台输出中发现了以下警告:该组件要求使用embedAsCFF = false声明嵌入式字体。
Thereafter i configured my Font-Style: 之后,我配置了我的字体样式:
@font-face {
src: url("assets/Sintony-Regular.ttf");
fontFamily: Sintony-Regular;
advancedAntiAliasing: true;
embedAsCFF: false;
embed-as-cff: flase;
font-lookup: embeddedCFF;
fontWeight: normal;
}
s|DateSpinner {
font-family: Sintony-Regular;
}
Now my DateSpinner works. 现在,我的DateSpinner可以工作了。 But many other components gives the warning: This component requires that the embedded font be declared with embedAsCFF= true .
但是许多其他组件也发出警告:该组件要求使用embedAsCFF = true声明嵌入字体。 It's not a fully solution, but a beginning.
这不是一个完整的解决方案,而是一个开始。 Mybe i have to use different font-face declarations.
我也许必须使用不同的字体声明。
Hope it works for you, too 希望它也对你有用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.