ListView未在ios中水平定向的ScrollView和StackLayout内部渲染-nativescript-vue

时间:2019-01-22 23:27:24

标签: android ios vue.js nativescript vue-nativescript

在ScrollView和StackLayout中在iOS中以水平方向实现时,ListView不会呈现,但在android中呈现-垂直和水平缩放表

  <ScrollView orientation="horizontal">
    <StackLayout orientation="horizontal">
      <RadListView for="todo in monthlyMeterData">
        <v-template>
          <GridLayout columns="150,100,100,100,100,100,100,100,100,100,100,100,100,100">
            <Label :text="todo.region" col="0"/>
            <Label :text="getMonthData(todo.monthlyCount,'January')" col="1"/>
            <Label :text="getMonthData(todo.monthlyCount,'January')" col="2"/>
            <Label :text="getMonthData(todo.monthlyCount,'January')" col="3"/>
            <Label :text="getMonthData(todo.monthlyCount,'January')" col="4"/>
            <Label :text="getMonthData(todo.monthlyCount,'January')" col="5"/>
            <Label :text="getMonthData(todo.monthlyCount,'January')" col="6"/>
            <Label :text="getMonthData(todo.monthlyCount,'January')" col="7"/>
            <Label :text="getMonthData(todo.monthlyCount,'January')" col="8"/>
            <Label :text="getMonthData(todo.monthlyCount,'January')" col="9"/>
            <Label :text="getMonthData(todo.monthlyCount,'January')" col="10"/>
            <Label :text="getMonthData(todo.monthlyCount,'January')" col="11"/>
            <Label :text="getMonthData(todo.monthlyCount,'January')" col="12"/>
            <Label :text="getMonthData(todo.monthlyCount,'January')" col="13"/>
          </GridLayout>
        </v-template>
      </RadListView>
    </StackLayout>
  </ScrollView>

Ios Android

1 个答案:

答案 0 :(得分:1)

由于某些原因,在iOS上,RadListView宽度未正确计算。由于您具有固定宽度的列,因此可以强制使用总宽度(1450)。另外,您不需要该<StackLayout>。我可以使用以下代码:

<ScrollView orientation="horizontal">
  <RadListView for="todo in monthlyMeterData" width="1450">
    <v-template>
      <GridLayout columns="150,100,100,100,100,100,100,100,100,100,100,100,100,100">
      <!-- ... -->

希望对您有帮助!