Using Date Spinner in flex mobile application

谁都会走 提交于 2019-12-12 02:34:15

问题


I am unable to use DateSpinner component in my flex mobile application. I am only interest to print date but not time. How can I achieve this in my flex mobile project. Platform is 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. DateSpinner.as:1290


回答1:


In the example code for the DateSpinner control, they are not wrapping it in a SpinnerListContainer. So perhaps that's your problem. Have you tried the DateSpinner by itself?

It appears to me that the SpinnerListContainer is intended to be used with a SpinnerList control. And that SpinnerList is for more generic lists, while DateSpinner is a stand alone component used specifically for dates/times.




回答2:


The given code doesn't work when displayMode property is set to "date" only.

<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"

even the simplest form to dataspinner gives error, like you use

<s:DateSpinner id="ds" />



回答3:


i've the same problem. After debugging the as-code i found a problem with determine the textsize. So i look at my console output i found this warning: This component requires that the embedded font be declared with 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. But many other components gives the warning: This component requires that the embedded font be declared with 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



来源:https://stackoverflow.com/questions/18560650/using-date-spinner-in-flex-mobile-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!