默认情况下,如何将Ionic设置为以iOS样式渲染? [英] How can Ionic be setup to render in the iOS style by default?
问题描述
现在,默认情况下,ionic应用程序将使用android样式进行渲染.我不想每次都使用?ionicplatform=ios
参数,而是希望它成为默认选项.
Right now the ionic app renders with android styling by default. Instead of using the ?ionicplatform=ios
param every single time I'd like that to be the default option.
我在config.xml
中以及在app.module.ts中的配置设置中寻找提示,例如:
I looked for hints in the config.xml
as well as the config settings in app.module.ts such as:
IonicModule.forRoot(
MyApp,
{
swipeBackEnabled: true,
platforms: {
ios: {
swipeBackEnabled: true,
statusbarPadding: false
}
}
}
),
无法找到一种优雅的方式...有什么想法吗?
and was unable to find an elegant way of doing it...Any ideas?
推荐答案
您只需要执行以下操作:
You just need to do this:
app.module.ts
imports: [
IonicModule.forRoot(MyApp,{
mode: 'ios'
})
],
注意:来自@sebaferreras
顺便说一句,通过设置此配置,该应用将使用ios样式和 组件,即使您在Android设备上运行它也是如此.请注意
?ionicplatform=ios
只是用来查看应用程序在什么时候的外观 使用浏览器,但不影响应用程序的构建方式.但 设置模式:"ios"将强制ios模式并应用ios样式 即使您创建并创建了.apk文件.
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.
这篇关于默认情况下,如何将Ionic设置为以iOS样式渲染?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!