gpt4 book ai didi

angularjs - 如何使 ionic 列表可滚动?

转载 作者:行者123 更新时间:2023-12-02 23:31:51 26 4
gpt4 key购买 nike

我试图通过添加 ion-scroll 来使 ionic-list 可滚动,但不是 ion-list 可滚动,而是整个页面变得可滚动。我如何使 ionic 列表可滚动?这是我的代码:

<ion-view title="Omnipay - Welcome" id="page5">
<ion-content padding="true" class="has-header">
<div>
<img src="img/omnipay_logo.jpg" style="display: block; width: 100%; height: auto; margin-left: auto; margin-right: auto;">
</div>
<h3 id="omnipayWelcome2-heading13" style="color:#000000;">My Info:</h3>
<h4 id="omnipayWelcome2-heading15" style="color:#000000;">Balance:</h4>
<h4 id="omnipayWelcome2-heading14" style="color:#000000;">Transaction History</h4>
<ion-scroll direction="xy" >
<ion-list can-swipe="listCanSwipe">
<ion-item ng-repeat="item in data1">
Date: {{item.date}}<br>Transaction: {{item.transaction}}<br>Merchant: {{item.merchant}}<br>Amount: {{item.amount}}
</ion-item>
</ion-list>
</ion-scroll>
<a ui-sref="menu.mainMenu" id="transactionHistory-button1" class="button button-positive button-block">Back</a>
<button class="button button-positive button-block" ng-click="refreshPage()">Refresh</button>
</ion-content>
</ion-view>

最佳答案

给你的<ion-scroll>指令a height属性:例如。

CodePen Demo/CodePen Full Page (在浏览器的移动 View 上观看效果最佳)

<ion-scroll style="height: 200px">
<ion-list>
<ion-item ng-repeat="item in items">{{item}}</ion-item>
</ion-list>
</ion-scroll>

关于angularjs - 如何使 ionic 列表可滚动?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42756322/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com