Search code examples
ios7ibm-mobilefirst

IBM Worklight 6.2 - Bottom white space in iOS 7


In IOS 7, there is 20 pixel white space at the bottom of the page. I am using worklight 6.2. I happened to read few other related documents and come to an understanding that this issue has been resolved from worklight 6.0.0.1.


Solution

  • I am a little surprised that you encounter this problem at the bottom - I've encountered it at the top but it was because the status bar was on top of the page.

    Please check this link out: http://www-01.ibm.com/support/docview.wss?uid=swg27039574 - this basically says that WL adds some classes with some CSS properties but this does not always work. That's why you have to turn to native code to exactly specify the dimensions of the UIWebView. In my case:

    CSS:

    #wl_ios7bar {
    display: none !important;
    }
    
    body.wl_ios7 {
        padding-top: 0px !important;
    }
    

    Objective-C:

    - (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.
        //Lower screen 20px on ios 7
        if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
            CGRect viewBounds = [self.webView bounds];
            viewBounds.origin.y = 18;
            viewBounds.size.height = viewBounds.size.height - 18;
            self.webView.frame = viewBounds;
        }
        [super viewWillAppear:animated];
    }
    

    Hope this helps!