Nativescript 滚动不适用于 stackLayout

标签 nativescript

我正在尝试学习 NativeScript,发现了 2 个独立的项目并尝试将它们组合起来,但是当我这样做时,滚动不起作用,你能解释一下为什么或者我做错了什么吗?

这是我的代码

<ActionBar title="myApp" class="action-bar">
</ActionBar>


  <GridLayout class="page" orientation="vertical">

    <ListView [items]="items" class="list-group">
        <ng-template let-item="item">
            <Label [nsRouterLink]="['/item', item.id]" [text]="item.name" 
      class="list-group-item"></Label>
        </ng-template>
    </ListView>

</GridLayout>
<TabView #tabview [selectedIndex]="tabindex" class="tab-view" 
 selectedColor="#4099FF" >

 <StackLayout align="top" *tabItem="{title:'Home',iconSource:'res://home'}">
    <home-tab></home-tab>
  </StackLayout>
  <StackLayout *tabItem="{title: 'Explore', iconSource:'res://explore'}">
    <Label class="border" borderWidth="5" borderColor="black" text="hey">
</Label>
</StackLayout>
<StackLayout *tabItem="{title: 'Notifications', 
iconSource:'res://notifications'}">
   </StackLayout>


</TabView>

在顶部我有选项卡,下面有项目列表,但无法向下滚动,它不起作用

最佳答案

使用<ScrollView> </ScrollView>围绕您要滚动的内容。 https://docs.nativescript.org/angular/code-samples/ui/scroll-view

关于Nativescript 滚动不适用于 stackLayout,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47601923/

相关文章:

angular - 错误 : cannot find module nativescript-angular/router or its corresponding type declarations

ios - 如何在 telerik nativescript 应用程序中添加 npm 模块

nativescript - 如何设置全局变量

javascript - 如何使用 Nativescript 从链接获取 ID

android - Nativescript 插件中的 Java 对象无效 'this'

javascript - 我如何将原始数据从 javascript 发送到 Nativescript 中的 ESC/POS 网络打印机(无蓝牙)

android - Android 上的 Nativescript 蓝牙只发现了一些设备并慢慢地进行

angular - Nativescript 后退按钮没有重定向到正确的页面

javascript - 我无法使用 NativeScript 在 jsPDF 中渲染图像

ios - 是否可以将 ios 13 beta 安装到 ios 模拟器中?