2016-06-06 14 views
1

Ich benutze das Apache Plugin: "cordova-plugin-statusbar" um die Statusleiste zu meinem App Theme zu färben.Zusätzliches Padding wird unterhalb der Statusleiste (in iOS) hinzugefügt, wenn Farbe zur Statusleiste hinzugefügt wird

Es folgt der Code-Snippet für Statusleiste Farbwechsel:

if(!StatusBar.isVisible){ StatusBar.show(); } StatusBar.overlaysWebView(false); StatusBar.backgroundColorByHexString(pinkColor); //pinkColor is defined

Aber das fügt eine zusätzliche Polsterung unter Statusleiste.

enter image description here

Antwort

0

ich eine andere bekam alternative Lösung. Da dies ein Plugin ist, ist das Ändern von "MainViewController" in XCode immer nach dem Build mühsam.

Statusleiste Plugin enthält CDVStatusBar.m Datei unter src/ios/

Ich habe -(void)resizeWebView bearbeitet:

if (!self.statusBarOverlaysWebView) { 
     CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame; 
     statusBarFrame = [self invertFrameIfNeeded:statusBarFrame]; 
     CGRect frame = self.webView.frame; 
     // frame.origin.y = statusBarFrame.size.height; 
     // frame.size.height -= statusBarFrame.size.height; 
     self.webView.frame = frame; 
} 

Ich habe Änderung in WebView Rahmengröße Kommentar gesetzt. Ich hoffe, das hilft jemandem mit dem gleichen Problem.

0

Ich nahm Lösung von status bar overlapping the view und verändert es nach meiner Anforderung

I modifiziert "(void) viewWillAppear" von "MainViewController.m":

- (void)viewWillAppear:(BOOL)animated 
{ 
    // View defaults to full size. If you want to customize the view's size, or its subviews (e.g. webView), 
    // you can do so here. 
    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) { 
     CGRect viewBounds = [self.webView bounds]; 
     viewBounds.size.height = viewBounds.size.height + 20; 
     self.webView.frame = viewBounds; 
    } 
    [super viewWillAppear:animated]; 
} 
0

In app.module.ts in ionischer 2

remove mode: 'md' in ios 

import { IonicApp, IonicModule } from 'ionic-angular'; 

@NgModule({ 
    declarations: [ MyApp ], 
    imports: [ 
    BrowserModule, 
    IonicModule.forRoot(MyApp, { 
    mode:md 
    }, {} 
)], 
    bootstrap: [IonicApp], 
    entryComponents: [ MyApp ], 
    providers: [] 
}) 
Verwandte Themen