所以我在我的页面上添加了2个离子滚动 . 示例代码在这里:http://codepen.io/anon/pen/QNNExR
第一个离子滚动工作正常,我可以左右滚动 .
对于第二个离子卷轴,那里有很多'测试'段落 . 我不能垂直滚动(顶部 - 底部) . 一旦我比屏幕高度稍微sc一点,它总会反弹回来 .
注意:由于高度不固定,我没有设置离子滚动或离子滚动内容的高度(例如:离子滚动高度取决于屏幕尺寸,应填充剩余的屏幕高度和内容高度取决于内容长度)
我做错了什么?谢谢 .
<html ng-app="ionicApp">
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title>Ionic vertical and horizontal Scroll</title>
<link href="//code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet">
<script src="//code.ionicframework.com/nightly/js/ionic.bundle.js"></script>
</head>
<body ng-controller="MyCtrl">
<ion-header-bar class="bar-positive">
<h1 class="title">Ionic vertical and horizontal Scroll</h1>
</ion-header-bar>
<ion-pane>
<ion-content>
<div>
<ion-scroll zooming="false" direction="x" scrollbar-x="false" scrollbar-y="false" has-bouncing="true" style="width: 100%;">
123
</ion-scroll>
</div>
<div>
<ion-scroll zooming="false" direction="y" style="width: 100%; height: 100%">
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
</ion-scroll>
</div>
</ion-content>
</ion-pane>
</body>
</html>
1 回答
使用
$ionicScrollDelegate
,$timeout
注入器在控制器中添加此项: