티스토리 뷰

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 currentDevicesystemVersionfloatValue] >= 7)

    {

        self.view.clipsToBounds = YES;

        CGRect screenRect = [[UIScreen mainScreenbounds];

        CGFloat screenHeight = 0.0;

        if(UIDeviceOrientationIsPortrait([[UIApplication sharedApplicationstatusBarOrientation]))

            screenHeight = screenRect.size.height;

        else

            screenHeight = screenRect.size.width;

        CGRect screenFrame = CGRectMake(020self.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(00self.view.frame.size.widthself.view.frame.size.height);

        }

    }

}



댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday