i want to create a field that looks like this ....can any one tell me how this could be done which field could i use where in i can select values by using the trackball/wheel or in case of storm i could slide...
相关问题
- JFX scale image up and down to parent
- convert string to DateTime in C# with EDT at the e
- Jackson to deserialize Joda LocalDate from ISO Dat
- SQL - Convert Time Series Events into On/Off Pairs
- @DateTimeFormat in Spring produces off-by-one day
相关文章
- How to truncate seconds in TSQL?
- How to remove seconds from datetime?
- OLS with pandas: datetime index as predictor
- Algorithm for maximizing coverage of rectangular a
- Calculate number of working days in a month [dupli
- Is there a way to hide the new HTML5 spinbox contr
- How can I convert a OLE Automation Date value to a
- Can keyboard of type UIKeyboardTypeNamePhonePad be
This is a comment to Max's post (not enough credits to post a comment so answer will do)
If you are using his post be advised that the calendar is being hard coded for every month having 31 days.
mDayOfMonthField = new NumTimeField(mDayOfMonth, 1, 31);
Instead of 31 you should use:
net.rim.device.api.util.DateTimeUtilities.getNumberOfDaysInMonth(month, year);
There is a new field introduced in the 5.0 API called SpinBoxFieldManager. For your specific case, there is also a DateTimePicker just for dates/times. For operating systems prior to 5.0, you'll need to create your own custom controls.
It could be simple Label or Bitmap Field extention, with navigation event handling.
You will need to hold String array with values which will be changed in circle on horizontal navigation.
If such custom Field is focused, draw Up and Down arrays.
So, there will be one such Field for DayOfWeek, one for Month, one for DayOfMonth, one for Year.
Place them all in HorizontalFieldManager, which will be placed in PopupScreen, on popup close geather all values and compose Date value (may be passed over FieldChangeListener)
UPDATE
Storm support
On devices with wheel its easy to implement save-and-close functionality on navigation click, but in Storm that would be a problem (dialog will be closed on each field focus action). To solve this, OK and Cancel buttons added.
Also, touchEvent added to handle proper value change using touch click.
You may keep different implementations for RIM OS <= 4.6 and RIM OS >= 4.7, and replace them on build task.
Source
alt text http://img519.imageshack.us/img519/7312/8300.pngalt text http://img267.imageshack.us/img267/6245/9000.jpg
alt text http://img9.imageshack.us/img9/9098/9530.png