2

我在我的 Nativecript-Vue 应用程序中使用 RadListView。在 iOS 上,在与列表视图交互后的某个时刻,元素开始四处移动,布局中断。

该视频清楚地显示了问题

我正在使用 ObservableArray 作为列表视图的数据源。起初,我在 LongPress 上扩展列表视图的项目,看起来所选项目上方的项目是唯一受影响的项目。我认为这可能与我的项目大小发生变化并影响已经绘制的项目有关。但是,如果我只是滚动并获取更多数据,它也会发生,所以它没有意义。我尝试使用简单的标签来最小化渲染工作,但它似乎并没有太大变化。我正在使用tns-ios v5.4.1nativescript-ui-listview 7.0.2

这是我的 RadListView 声明:

<RadListView ref="listView" for="item in itemList" layout="linear" loadOnDemandMode="Auto" orientation="vertical" pullToRefresh="true" swipeActions="true" :itemTemplateSelector="templateSelector" @itemSwipeProgressStarted="onSwipeStarted" @itemTap="onTap"
  @loadMoreDataRequested="onLoadMoreData" @pullToRefreshInitiated="onPullToRefresh">
  <v-template name="normal">
    <GridLayout class="px-4 bg-white border-gray-350 border-b" columns="3*, 10*, 3*">
      <AbsoluteLayout class="w-full h-full my-4" col="0">
        <activix-wrapped-icon class="p-3" width="64" height="64" background-color="bg-gray-600" icon-size="text-3xl" :icon-name="getLeadTypeIcon(item.lead_type_id)" />
      </AbsoluteLayout>

      <FlexboxLayout verticalAlignment="center" flexDirection="column" class="mx-4" col="1">
        <Label class="font-semibold" fontSize="16" :text="item.name" />

        <StackLayout class="mt-1" orientation="horizontal">
          <activix-icon name="car" />

          <Label class="ml-2" fontSize="16" :text="item.wanted_vehicle_text" />
        </StackLayout>
      </FlexboxLayout>

      <FlexboxLayout justifyContent="flex-end" verticalAlignment="center" col="2">
        <FlexboxLayout alignItems="center" justifyContent="center" height="24" width="24" class="rounded-sm" :class="getResultColor(item.result_normalized)">
          <Label class="font-bold text-white uppercase" fontSize="12" :text="getResultSymbol(item.result_normalized)" />
        </FlexboxLayout>

        <activix-icon class="ml-4 text-2xl" name="arrow-right" />
      </FlexboxLayout>
    </GridLayout>
  </v-template>
</RadListView>

我希望我的布局元素保持在原处,当我滚动时不会移动和重叠在其余内容上。我想利用 RadListView 的手势,例如滑动和长按,但基本行为确实有问题。任何帮助,将不胜感激!

4

0 回答 0