• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Trigger the native IOS datePicker?

Community Beginner ,
Apr 10, 2013 Apr 10, 2013

Copy link to clipboard

Copied

Hello guys, does anyone know if it's possible to trigger the IOS Native Date Picker from Adobe Air?

thanks so much for any info!

TOPICS
Development

Views

3.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 10, 2013 Apr 10, 2013

Copy link to clipboard

Copied

Unfortunately AIR does not expose access to any of the native controls. Their might be an ANE that would expose it, but I have not seen one. The lack of access to default widgets has always been one of the weak points of AIR. It is fully capable if you have a 100% custom UI, but if you need to use 'native' widgets you are out of luck.

Chris

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 11, 2013 Apr 11, 2013

Copy link to clipboard

Copied

This might not be the answer you hoped for, but you could make your own datepicker look like iPhone's native one. I've done this ones, using Greensocks ThrowPropsPlugin to flick movieclips that contained days, month and year. Combining it with Flash's Date class.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 12, 2014 Feb 12, 2014

Copy link to clipboard

Copied

Hey Las, do you mind share a sample code doing custom Date Picker? Maybe somewhere in GitHub?

Thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Feb 13, 2014 Feb 13, 2014

Copy link to clipboard

Copied

Unfortunately this was a while ago, on a project I no longer have immediate access to. And it was made looking like the IOS 6 date picker where the wheel didn't have any "real" curve, so the text didn't need to skew at the top or bottom (it only had shadows from the outer frame).

Now with IOS 7, the dates that disappear at the visual edges sort of shrink and curve a bit, making it more tricky. I agree with Anton Azarov that Native Extention would probably be the easiest way if you want it to look "IOS 7"-ish.

However, if you don't really need the text distortion at the wheel edges, you could do as I and generate x number of dates, and adding them to three movieclips, making three columns. For instance the first column would consist of a textfield created this way:   

var days:Array = ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];

var months:Array = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];

var date:Date;

var tf:TextField = new TextField();

tf.width = 200;

tf.height = 400;

myColumnMc.addChild(tf);

for(var i:int = 0; i<60; i++){

  date = new Date();

  date.setDate((date.date - 30) + i);

  tf.appendText(days[date.getDay()] + " " + months[date.getMonth()] + " " + date.getDate() + "\n");

}

This way I had dates before and after current date. Then I made them draggable with easing and velocity when released, using the ThrowPropsPlugin (this is a paid plugin, but you could of course write your own).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Feb 12, 2014 Feb 12, 2014

Copy link to clipboard

Copied

You can develop or request payed help from that who know how to do Native Extension. DatePicker it's not most hard thing that can be coded in Native Extension.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Feb 13, 2014 Feb 13, 2014

Copy link to clipboard

Copied

Google it. I just heared that DatePicker already exist on some github and ready to use as Native Extension. So it will be Native to iOS.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jul 07, 2014 Jul 07, 2014

Copy link to clipboard

Copied

LATEST

A native extension is the only way I know of doing this at the moment

Our Dialog ANE, has date time pickers if your interested in a well supported extension: http://distriqt.com/product/air-native-extensions/dialog

air native extensions // https://airnativeextensions.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines