gpt4 book ai didi

angularjs - ionic 内容不滚动

转载 作者:行者123 更新时间:2023-12-03 06:45:36 24 4
gpt4 key购买 nike

我查了很多答案,但没有一个对我有用。我有一个简单的 .html 文件, ionic 内容只是不滚动。

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->
<script src="js/platformOverrides.js"></script>

<script src="scripts/angular-resource.min.js"></script>
<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>

<script src="scripts/jquery.min.js"></script>
<script src="scripts/angular-sanitize.min.js"></script>
<script src="scripts/angular-ui-router.js"></script>
<script src="scripts/angular-resource.js"></script>
<script src="scripts/lodash.min.js"></script>

<script src="js/app.js"></script>
<script src="js/appController.js"></script>
</head>
<body ng-app="app" ng-controller="appController">
<ion-pane>
<ion-header-bar class="bar-stable">
<h1 class="title">Ionic Blank Starter</h1>
</ion-header-bar>
<ion-view>
<ion-content scroll="true">
<div class="scroll">
<a ng-repeat="item in items" class="item" href="#">
<h2>{{item.name}}</h2>
</a>
</div>
</ion-content>
</ion-view>
</ion-pane>
</body>
</html>

上面,$scope.items 是从某个 Web 服务中获取的。一切都渲染得很好,但它只是不滚动。如果重要的话,我正在使用 Visual studio 'Ionic Blank Template'。我已正确配置 Cordova,其余所有解决方案都可以正常工作。

最佳答案

从 div 容器中删除 class="scroll",从 ion-content 中删除 scroll="true" 并添加 溢出滚动=“true”。所需的类将由 ionic 添加到元素上。您不需要明确添加

<ion-view>
<ion-content overflow-scroll="true">
<div class="list">
<a ng-repeat="item in items" class="item" href="#">
<h2>{{item.name}}</h2>
</a>
</div>
</ion-content>
</ion-view>

更新:在 Chrome 模拟器中显示可滚动列表的 codepen:http://codepen.io/addi90/full/RaOegM/

Ionic scrollable list

关于angularjs - ionic 内容不滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37230979/

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