Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
List 空中移动应用程序列表问题_List_Mobile_Air_Flash Builder_Itemrenderer - Fatal编程技术网

List 空中移动应用程序列表问题

List 空中移动应用程序列表问题,list,mobile,air,flash-builder,itemrenderer,List,Mobile,Air,Flash Builder,Itemrenderer,有werid问题 如果我返回更多的数据行,那么屏幕上会显示什么 当我开始滚动列表时,记录1中的数据正在 滚动条上的下一个显示项 示例10数据记录 1. 2. 3. 4. 展示 开始滚动 5是1号数据 6可显示1或2个数据 等等 列表中显示了10条记录 但信息是不正确的 这是密码 protected function display_gas_pricesResult_resultHandler(event:ResultEvent):void { cu

有werid问题

如果我返回更多的数据行,那么屏幕上会显示什么 当我开始滚动列表时,记录1中的数据正在 滚动条上的下一个显示项

示例10数据记录 1. 2. 3. 4. 展示

开始滚动 5是1号数据 6可显示1或2个数据 等等

列表中显示了10条记录 但信息是不正确的

这是密码

        protected function display_gas_pricesResult_resultHandler(event:ResultEvent):void
        {
        currentState='start_here';
        this.list.dataProvider=null;
        this.list.dataGroup.invalidateDisplayList();
        label_waterway.text=this.BoaterObject.waterway;
        var _itemRenderer:IFactory=this.list.itemRenderer;
        this.list.itemRenderer=null;
        this.list.itemRenderer=_itemRenderer;
        this.list.dataProvider=TypeUtility.convertToCollection(display_gas_pricesR esult.lastResult);
        this.list.validateDisplayList();
        }



<s:List id="list"
    width="100%"
    height="100%"
    change="list_changeHandler(event)"
    contentBackgroundAlpha="0"
    pageScrollingEnabled="true"
    borderVisible="true"
    scrollSnappingMode="leadingEdge"
    itemRenderer="renderers.ir_gas_prices">
 <s:layout>
    <s:VerticalLayout/>
 </s:layout>
</s:List>

<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        width="100%" color="#000000"
        creationComplete="itemrenderer1_creationCompleteHandler(event)"
        autoDrawBackground="false" contentBackgroundAlpha="0">
        <s:layout>
        <s:HorizontalLayout gap="1"
        paddingBottom="5"
        paddingLeft="5"
        paddingRight="5"
        paddingTop="5"
        verticalAlign="middle"/>
        </s:layout>
        <fx:Script>
        <![CDATA[
        import mx.events.FlexEvent;

        protected function itemrenderer1_creationCompleteHandler(event:FlexEvent):void
        {
        if (data.gas_price_id == '0')
        {
        currentState='no_prices';

        }
        else
        {
        currentState='show_price';
        label_name.text=data.name;
        label_status.text=data.status;
        label_gas.text=data.gas_price;
        label_diesel.text=data.diesel_price;
        label_date.text=data.date;
        label_boatname.text=data.boat_name;
        }
        }
        ]]>
        </fx:Script>
        <s:states>
        <s:State name="show_price"/>
        <s:State name="no_prices"/>
        </s:states>
        <s:BorderContainer width.show_price="100%" height.show_price="100%" cornerRadius.show_price="10"
           dropShadowVisible.show_price="true">
        <s:layout.show_price>
        <s:HorizontalLayout paddingBottom="5" paddingLeft="5" paddingRight="5" paddingTop="5"/>
        </s:layout.show_price>
        <s:VGroup width="15%"
          horizontalAlign="center">
        <s:Image width="56"
         height="46"
         source="@Embed('assets/basic1-088.png')"/>
        <s:Label id="label_status" includeIn="show_price" width="100%" color="#662100" fontSize="18"
         text="Label" textAlign="center"/>
        </s:VGroup>
        <s:VGroup width="100%"
          gap="1">
        <s:HGroup width="100%">
        <s:Label id="label_name" includeIn="show_price" width="100%" color="#662100"
         fontSize="20" fontWeight="bold" text="Label"/>
        <s:Label includeIn="no_prices"
         fontSize="16"
         text="Sorry no one has posted any fuel prices yet.&#xd;Be the first to post fuel prices on this water way.&#xd;Click the add button "/>
        </s:HGroup>
        <s:HGroup includeIn="show_price"
          width="100%"
          horizontalAlign="left"
          paddingLeft="20">
        <s:VGroup gap="1"
          horizontalAlign="center"
          verticalAlign="top">
        <s:Label fontSize="18"
         fontWeight="bold"
         text="Gas"/>
        <s:HGroup width="100%">
        <s:Label fontFamily="_typewriter"
         fontSize="24"
         fontWeight="bold"
         text="$"/>
        <s:Label id="label_gas"
         color="#FF0303"
         fontFamily="_typewriter"
         fontSize="24"
         fontWeight="bold"
         text="Label"/>
        </s:HGroup>
        </s:VGroup>


        <s:VGroup gap="1"
          horizontalAlign="center"
          verticalAlign="top">
        <s:Label fontSize="18"
         fontWeight="bold"
         text="Diesel"/>
        <s:HGroup width="100%">
        <s:Label fontFamily="_typewriter"
         fontSize="24"
         fontWeight="bold"
         text="$"/>
        <s:Label id="label_diesel"
         color="#00CA26"
         fontFamily="_typewriter"
         fontSize="24"
         fontWeight="bold"
         text="Label"/>
        </s:HGroup>
        </s:VGroup>
        <s:Spacer width="20%"
          height="10"/>
        <s:VGroup width="50%"
          gap="1"
          horizontalAlign="right">
        <s:Label id="label_date"
         width="100%"
         fontSize="16"
         text="Label"
         textAlign="right"/>
        <s:HGroup width="100%"
          horizontalAlign="right">
        <s:Label fontSize="16"
         fontWeight="bold"
         text="By:"/>
        <s:Label id="label_boatname"
         fontSize="16"
         text="Label"/>
        </s:HGroup>
        </s:VGroup>
        </s:HGroup>
        </s:VGroup>
        </s:BorderContainer>
        </s:ItemRenderer>
protected function display\u gas\u pricesResult\u resultHandler(事件:ResultEvent):void
{
currentState='start_here';
this.list.dataProvider=null;
this.list.dataGroup.invalidateDisplayList();
label_waterway.text=this.BoaterObject.waterway;
var_itemrender:IFactory=this.list.itemrender;
this.list.itemRenderer=null;
this.list.itemRenderer=\u itemRenderer;
this.list.dataProvider=TypeUtility.convertToCollection(显示\u gas\u pricesR esult.lastResult);
this.list.validateDisplayList();
}

出于性能考虑,当List.useVirtualLayout==true(这是默认值)时,会重用ItemRenders。 要使其可重用,请确保在其数据发生更改时,所有标签等都重置为其默认值。 为了实现这一点,重写

set data(value:Object):void 
函数,每当向渲染器设置新数据时调用该函数

“creationComplete”事件将在创建渲染器时仅触发一次,这意味着您的显示将无法正确更新