0

I'm showing date picker using following ane

https://github.com/freshplanet/ANE-DatePicker

In iphone it always show datepicker at the bottom. I take a look at AirDatePicker.as, in iPad I can do it, but not found any way for custom positioning in iphone.

Shashikant More
  • 304
  • 1
  • 5
  • 22

1 Answers1

1

This can be done using FPNativeUI.ane:



    package control
    {
        import flash.display.Sprite;
        import flash.geom.Rectangle;
        import flash.system.Capabilities;

        import ru.flashpress.nui.FPNativeUI;

        import ru.flashpress.nui.view.control.FPDatePicker;
        import ru.flashpress.nui.events.FPDatePickerEvent;
        import ru.flashpress.nui.view.system.FPWindowView;

        public class DatePickerProgrammatically extends Sprite
        {
            private var datePicker:FPDatePicker;
            public function DatePickerProgrammatically()
            {
                FPNativeUI.init();
                //
                var w:int = Capabilities.screenResolutionX;
                //
                var bounds:Rectangle = new Rectangle(0, 100, w, 400);
                FPWindowView.window.screen.boundsFlashToNative(bounds);
                //
                datePicker = new FPDatePicker();
                datePicker.frame = bounds;
                //
                datePicker.stage.addChild(datePicker);
                datePicker.addEventListener(FPDatePickerEvent.VALUE_CHANGED, valueChangeHandler);
            }

            private function valueChangeHandler(event:FPDatePickerEvent):void
            {
                trace(event.date);
            }
        }
    }

Serious Sam
  • 101
  • 1
  • 4