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

SpinnerList not working in AIR 20

Community Beginner ,
Feb 23, 2016 Feb 23, 2016

Copy link to clipboard

Copied

Any ideas why the SpinnerList would no longer work in AIR 20? It works fine when I revert back to AIR 16, which is the version I was using. My SpinnerList no longer displays any texts, and also does not scroll, although the values do seem to change even though it seems that nothing is happening visually. My spinner code looks like this:

<s:SpinnerListContainer>

  <s:SpinnerList id="genderSpinner" fontFamily="Myriad Pro Bold Condensed 2" fontWeight="normal" fontSize="16" width="170" height="125" labelField="name" selectedIndex="{preLoadedSelectedIndex}">

  <s:ArrayList>

  <fx:Object name="Male" genderNode="male"/>

  <fx:Object name="Female" genderNode="female"/>

  </s:ArrayList>                       

  </s:SpinnerList>

  </s:SpinnerListContainer>

Any thoughts?

TOPICS
Air beta

Views

416

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 Beginner ,
Feb 23, 2016 Feb 23, 2016

Copy link to clipboard

Copied

LATEST

Alright, so I feel like I'm on a roll today and found the culprit for this issue too. It's related to this other issue I had here AIR 20 Display issue . Whenever I do cacheAsBitmap = false, then everything displays correctly. The trick to doing this is use an itemRenderer for the spinner:

<s:SpinnerList id="genderSpinner" fontFamily="Myriad Pro Bold Condensed 2" itemRenderer="renderers.SpinnerListItemRenderer" fontWeight="normal" fontSize="16" width="170" height="125" labelField="name" selectedIndex="{preLoadedSelectedIndex}">

  <s:ArrayList>

  <fx:Object name="Male" genderNode="male"/>

  <fx:Object name="Female" genderNode="female"/>

  </s:ArrayList>                       

  </s:SpinnerList>

Then, in your custom Item Renderer, use the spark.components.SpinnerListItemRenderer, and simply add this to your own implementation:

public function SpinnerListItemRenderer()

  {

  super();

  this.cacheAsBitmap = false;

  switch (applicationDPI)

  {

  case DPIClassification.DPI_640:

  {

  minHeight = 40;

  break;

  }

  case DPIClassification.DPI_480:

  {

  minHeight = 30;

  break;

  }

  case DPIClassification.DPI_320:

  {

  minHeight = 20;

  break;

  }

  case DPIClassification.DPI_240:

  {

  minHeight = 15;

  break;

  }

  case DPIClassification.DPI_120:

  {

  minHeight = 8;

  break;

  }

  default: // default PPI160

  {

  minHeight = 10;

  break;

  }

  }

  }

And voila! Adobe, I sure hope you are reading this, lets get cacheAsBitmap working on AIR 20, as it does drastically improve performance on mobile!

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