2017-10-10 11 views
1

Iv는 Cordova Inappbrowser를 사용하는 앱 및 앱을 생성하도록 지정되었습니다. 공식 inappbrowser 플러그인 및 상태 표시 줄 플러그인을 사용 중입니다. 모든 플러그인은 최대 개까지 있습니다!IOS 11.2 Cordova Inappbrowser는 방향 변경에 회색 블록을 추가합니다.

장치의 방향이 변경되면 회색 블록이 왼쪽 상단에 나타납니다. Xcode의 시뮬레이터와 환경 검사기 도구를 사용하여 회색 블록이 무엇인지 찾아 내고, 검사를 원하지 않습니다. 필자는 몇 가지 장치 iPhone 6 및 7+ 및 iPad mini 4를 테스트했으며 여전히 장치에 나타납니다.

config.xml의 상태 표시 줄

<platform name="ios"> 
    <config-file parent="UIStatusBarHidden" platform="ios" target="*-Info.plist"> 
     <true /> 
    </config-file> 
    <config-file parent="UIViewControllerBasedStatusBarAppearance" platform="ios" target="*-Info.plist"> 
     <true /> 
    </config-file> 
    <allow-intent href="itms:*" /> 
    <allow-intent href="itms-apps:*" /> 
</platform> 

내 inappbrowser 코드를 숨기기위한

내 코드

var url = "https://imgur.com/"; 
    var ref = cordova.InAppBrowser.open(url, '_blank', 'location=no,toolbar=no'); 

내 첫하지만 문제는, URL에 관련이 inappbrowser에서 사용되는 것을했지만, 나는 몇몇 위치를 시험하고 각자 동일한 결과를 가져왔다.

Im 상태 표시 줄 플러그인을 사용하면 작동하는 상태 표시 줄을 숨길 수 있습니다.

App on Start up. no grey block

및 방향을 heres 때 변경 통지 회색 블록.

- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator 
{ 
    CGRect frame = [UIApplication sharedApplication].statusBarFrame; 
    [_bgToolbar setFrame:CGRectMake(frame.origin.x, frame.origin.y, size.width, frame.size.height)]; 
    [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; 
} 

변수 _bgToolbar가있는 viewDidLoad 메소드에서 초기화 한 경우 : CDVInAppBrowserNavigationController 구현 내에서 CVDInAppBrowser.m이 추가

enter image description here

답변

0

는 트릭을 수행합니다.

희망이 도움이됩니다.

+0

viewDidLoad 메서드의 _bgToolbar가 작동하는 방법을 명확히 할 수 있습니다. 해당 메서드에서 변수 bgToolbar 만 사용하면 다른 하나는 참조가되고 아마도 viewDidLoad 메서드를 추가 할 수 있습니까? 미리 감사드립니다. –

관련 문제