Android Nativescript Listview不可滚动
我正在使用Nativescript Vue开发一个应用程序。我有一个WrapLayout,里面有ListView(还有其他组件)Android Nativescript Listview不可滚动,android,listview,nativescript,nativescript-vue,Android,Listview,Nativescript,Nativescript Vue,我正在使用Nativescript Vue开发一个应用程序。我有一个WrapLayout,里面有ListView(还有其他组件) 因此,我将项目添加到应用程序的列表视图中(selectedDayNotes更新,列表视图显示新元素),但列表视图不可滚动。我应该怎么做才能使它滚动呢?好吧,我成功地将这个工作列表视图包装到了ScrollView中。有点奇怪,医生们什么也没说 代码如下: <ScrollView class="home__notes-list-wrapper">
因此,我将项目添加到应用程序的列表视图中(selectedDayNotes更新,列表视图显示新元素),但列表视图不可滚动。我应该怎么做才能使它滚动呢?好吧,我成功地将这个工作列表视图包装到了ScrollView中。有点奇怪,医生们什么也没说 代码如下:
<ScrollView class="home__notes-list-wrapper">
<ListView for="event in selectedDayNotes" class="home__notes-list">
<v-template>
//whatever you want inside some sort of layout
<WrapLayout class="home__notes-list-item">
<Label class="home__notes-list-item-note" :text="event.title" />
<Label class="home__notes-list-item-time" :text="event.startDate.getHours() + ':' + event.startDate.getMinutes() + ' - '" />
<Label class="home__notes-list-item-time" :text="event.endDate.getHours() + ':' + event.endDate.getMinutes()" />
</WrapLayout>
</v-template>
</ListView>
</ScrollView>
//在某种布局中,你想要什么都行
我还设置了CSS中所需的滚动视图高度 不建议在ScrollView中使用ListView。因为ListView本身是ScrollView的扩展版本,所以ListView本身应该是可滚动的。如果您在滚动方面仍然存在问题,请共享一个游乐场示例,以便重现该问题。
&__notes-list-item {
background: white;
}
&__notes-list-item-note {
font-size: 15px;
width: 100%;
}
&__notes-list-item-time {
font-size: 18px;
font-weight: 600;
}
<ScrollView class="home__notes-list-wrapper">
<ListView for="event in selectedDayNotes" class="home__notes-list">
<v-template>
//whatever you want inside some sort of layout
<WrapLayout class="home__notes-list-item">
<Label class="home__notes-list-item-note" :text="event.title" />
<Label class="home__notes-list-item-time" :text="event.startDate.getHours() + ':' + event.startDate.getMinutes() + ' - '" />
<Label class="home__notes-list-item-time" :text="event.endDate.getHours() + ':' + event.endDate.getMinutes()" />
</WrapLayout>
</v-template>
</ListView>
</ScrollView>