android – 默认情况下,如何设置Ionic以iOS风格呈现?
作者:互联网
现在,离子应用程序默认使用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.
标签:android,ios,angular,ionic2,ionic3 来源: https://codeday.me/bug/20190714/1458032.html