ionic-framework - 如何改变离子的滑动方向?
问题描述
我试图在两个方向(左和右)上滑动,但无论我做什么滑动,页面总是从右到左弹出。我该怎么做,如果我从左向右滑动页面从左侧出现,如果我向右滑动,页面从右侧出现?
这是我的代码:
page.html:
<ion-content class="home_content" (swipe)="swipe($event)" padding>
</ion-content>
页面.ts
swipe(event) {
if(event.direction == '2') {
this.navCtrl.push(Page1);
}
if(event.direction == '4') {
this.navCtrl.push(Page2);
}
}
}
该代码有效并推送到两个页面,但它们出现在同一侧(右侧)。
解决方案
推荐阅读
- python - 无法在 python 3.7 中使用 cx_oracle 6.4 将 Django 2.0.7 与 oracle 12c 连接
- docker - 基于windowsservercore的docker下载问题(Appveyor, Visual Studio 2017)
- xml - 使用 xslt 对标签设置条件?
- javascript - 如果所有现有幻灯片都在 BX Slider 中结束,则循环到第一张幻灯片
- html - 在知道组件字符串名称的Angular 2中动态插入组件
- ios - 将 StoryBoard 从 Xcode8 更新到 Xcode9 时出现 UI 问题
- kotlin - TypeConverters 无法弄清楚如何将此字段保存到数据库中
- react-native - 无法从 React 本机项目调用 ios 本机模块
- c# - 使用终结器关闭 EventHubClient
- android - 如何从相机捕获多张图像并使用位图将其编码为字符串?