现在,离子应用程序默认使用android样式呈现.我不希望每次都使用?ionicplatform = ios param作为默认选项.
我查找了config.xml中的提示以及app.module.ts中的配置设置,例如:
IonicModule.forRoot(
MyApp,
{
swipeBackEnabled: true,
platforms: {
ios: {
swipeBackEnabled: true,
statusbarPadding: false
}
}
}
),
而且无法找到一种优雅的方式……任何想法?
解决方法:
你只需要这样做:
app.module.ts
imports: [
IonicModule.forRoot(MyApp,{
mode: 'ios'
})
],
注意:来自@sebaferreras
Btw, by setting this config the app will use the ios styles and
components even if you run it on an Android device. Please notice
that?ionicplatform=ios is just used to see how the app looks like when
using the browser, but does not affect how the app is built. But
setting mode: ‘ios’ will force the ios mode and apply the ios styles
even if you build and create a .apk file.
原文地址:https://codeday.me/bug/20190714/1458032.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。