티스토리 뷰
IOS 10.2 작업 기준
◈ Xcode에서 작업
1.CordovaLib.xocdeproj 에서 Public 라는 폴더를 찾음
2.해당 폴더에서 CDVViewController.m 이라는 파일을 찾음
3.viewWillLayoutSubviews 라는 부분을 찾아서 아래 코드를 삽입
-(void)viewWillLayoutSubviews { //[super viewWillLayoutSubviews]; //[[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewWillLayoutSubviewsNotification object:nil]];
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) { self.view.clipsToBounds = YES; CGRect screenRect = [[UIScreen mainScreen] bounds]; CGFloat screenHeight = 0.0; if(UIDeviceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation])) screenHeight = screenRect.size.height; else screenHeight = screenRect.size.width; CGRect screenFrame = CGRectMake(0, 20, self.view.frame.size.width,screenHeight-20); CGRect viewFr = [self.view convertRect:self.view.frame toView:nil]; if (!CGRectEqualToRect(screenFrame, viewFr)) { self.view.frame = screenFrame; self.view.bounds = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height); } } } |
'[개발]프로그래밍 > cordova' 카테고리의 다른 글
[IOS] 상하단 오버해서 스크롤 되는 거 막기 (0) | 2018.04.18 |
---|
- Total
- Today
- Yesterday