我使用Ionic 2构建了一个应用程序.当我在浏览器中运行它时,UI看起来不错,但是一旦我在iOS模拟器中运行,一切看起来都很笨重.问题在于状态栏.我需要隐藏状态栏.我尝试使用离子原生的StatusBar,像这样 –
import {StatusBar} from 'ionic-native'; constructor(platform: Platform) { platform.ready().then(() => { // Okay,so the platform is ready and our plugins are available. // Here you can do any higher level native things you might need. StatusBar.hide(); //StatusBar.styleDefault(); });
解决方法
我正在研究ionic3,并希望它也适用于离子2.
我也需要相同的,这是我的本地设置 –
我也需要相同的,这是我的本地设置 –
li packages: (/usr/local/lib/node_modules) @ionic/cli-utils : 1.12.0 ionic (Ionic CLI) : 3.12.0 global packages: cordova (Cordova CLI) : 7.0.1 local packages: @ionic/app-scripts : 2.1.4 Cordova Platforms : android 6.2.3 ios 4.4.0 Ionic Framework : ionic-angular 3.6.0
现在对以下文件进行更改 –
config.xml中
<preference name="Fullscreen" value="true" />
Component.ts
StatusBar.overlaysWebView(true);
这对我有用.
Note:- Changes will reflect in simulator or android phone only,not in browser.