将离子滚动包装到离子列表时遇到了一个小问题。
这是我的代码:
<ion-content>
<!-- The list directive is great, but be sure to also checkout the collection repeat directive when scrolling through large lists -->
<ion-list show-delete="data.showDelete" show-reorder="data.showReorder">
<ion-scroll style="height: 300px" >
<ion-item ng-repeat="item in items"
item="item"
href="#/item/{{item.id}}" class="item-remove-animate">
Item {{ item.id }}
<ion-delete-button class="ion-minus-circled"
ng-click="onItemDelete(item)">
</ion-delete-button>
<ion-option-button class="button-assertive"
ng-click="edit(item)">
Edit
</ion-option-button>
<ion-option-button class="button-calm"
ng-click="share(item)">
Share
</ion-option-button>
<ion-reorder-button class="ion-navicon" on-reorder="moveItem(item, $fromIndex, $toIndex)"></ion-reorder-button>
</ion-item>
</ions-scroll>
</ion-list>
</ion-content>
http://codepen.io/anon/pen/yNyjGx
我想要的是防止在 ion-item 上滑动时滚动,默认值正在工作,但是当我尝试包装它时,它不起作用,您能帮我提供一些替代方案吗?
问题是我想用 css 调整离子列表的高度,所以我在离子列表内使用离子滚动
这是该问题的简化解决方案。取下离子涡旋并给出离子含量的高度。
代码笔在这里
<ion-content style='height : 300px'>
在离子含量中使用has-bouncecing="false"
<ion-content has-bouncing="false">
<!-- The list directive is great, but be sure to also checkout the collection repeat directive when scrolling through large lists -->
<ion-list show-delete="data.showDelete" show-reorder="data.showReorder">
<ion-scroll style="height: 300px" >
<ion-item ng-repeat="item in items"
item="item"
href="#/item/{{item.id}}" class="item-remove-animate">
Item {{ item.id }}
<ion-delete-button class="ion-minus-circled"
ng-click="onItemDelete(item)">
</ion-delete-button>
<ion-option-button class="button-assertive"
ng-click="edit(item)">
Edit
</ion-option-button>
<ion-option-button class="button-calm"
ng-click="share(item)">
Share
</ion-option-button>
<ion-reorder-button class="ion-navicon" on-reorder="moveItem(item, $fromIndex, $toIndex)"></ion-reorder-button>
</ion-item>
</ions-scroll>
</ion-list>
</ion-content>