【问题标题】:Nativescript scroll doesn't work with stackLayoutNativescript 滚动不适用于 stackLayout
【发布时间】:2017-12-01 21:45:58
【问题描述】:

我正在尝试学习 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>

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

【问题讨论】:

    标签: nativescript


    【解决方案1】:

    在要滚动的内容周围使用&lt;ScrollView&gt; &lt;/ScrollView&gt;https://docs.nativescript.org/angular/code-samples/ui/scroll-view

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-19
      • 2021-05-07
      • 1970-01-01
      • 2021-01-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多