기기 회전 지원은 실제로 구현되지 않았습니다. 찾는 단계이다 :
function redrawTabBar() {
if (navigator.notification){
PhoneGap.exec("NativeControls.redrawTabBar");
}
}
3)의 방법을 추가 배향 변화가있을 때
document.addEventListener("orientationChanged",redrawTabBar,false);
2)라는 함수를 추가
1) 배향 리스너를 추가 실제 플러그인 (.m) :
- (void)redrawTabBar:(NSArray*)arguments withDict:(NSDictionary*)options
{
tabBar.frame=CGRectMake(0, self.webView.frame.size.height, self.webView.frame.size.width, 50);
}
4) orientationChanged 이벤트 webview에 의해 해고됩니다. Inside MainViewcontroller.m
- (void)didRotateFromInterfaceOrientation: (UIInterfaceOrientation)fromInterfaceOrientation
{
int i = 0;
switch (self.interfaceOrientation){
case UIInterfaceOrientationPortrait:
i = 0;
break;
case UIInterfaceOrientationPortraitUpsideDown:
i = 180;
break;
case UIInterfaceOrientationLandscapeLeft:
i = -90;
break;
case UIInterfaceOrientationLandscapeRight:
i = 90;
break;
}
NSString* jsString =
@"(function(){"
"var e = document.createEvent('Events');"
"e.initEvent('orientationChanged');"
"document.dispatchEvent(e);"
"})();";
NSLog(@"Orientation Changed");
[self.webView stringByEvaluatingJavaScriptFromString:jsString];
}
동일한 정확한 문제가 있습니다. 그러나 MainViewcontroller.m 파일이없는 것 같습니다. 그 조각을 분명히 할 수 있니? –