Search code examples
iosios7uistatusbarjasidepanels

iOS JASidePanel status bar customization


I am using JASidePanels in my app and everything is so far so good. My design team have come up with a UI design like this, when the side panel is shown or revealed,

enter image description here

But I am able to reproduce like! this.

enter image description here

What all I have tried so far:

I tried setting the center panels background color to the image that I have in the right panel - No luck.

I tried setting the sidePanel.view.backgroundColor and also tintColor - No luck.

Any help is appreciated!


Solution

  • This is JASidePanels's bug , however they fixed the issue by doing this: in the JASidePanelsController add below code to _adjustCenterFrame

    - (CGRect)_adjustCenterFrame {
        CGRect frame = self.view.bounds;
    
        if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0"))
        {
            if (![UIApplication sharedApplication].statusBarHidden) {
                            frame.origin.y = frame.origin.y + [UIApplication sharedApplication].statusBarFrame.size.height;
                            frame.size.height = frame.size.height - 20;
                        }
    
            } 
    ...
    }
    

    Also in _layoutSideContainers add :

    - (void)_layoutSideContainers:(BOOL)animate duration:(NSTimeInterval)duration {
        CGRect leftFrame = self.view.bounds;
        CGRect rightFrame = self.view.bounds;
    
    
    
        if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0"))
        {
            if (![UIApplication sharedApplication].statusBarHidden) {
                        leftFrame.origin.y = leftFrame.origin.y + [UIApplication sharedApplication].statusBarFrame.size.height;
                        rightFrame.origin.y = rightFrame.origin.y + [UIApplication sharedApplication].statusBarFrame.size.height;
                leftFrame.size.height = leftFrame.size.height - 20;
                rightFrame.size.height = rightFrame.size.height - 20;
                            }
                }
    
        ...
    }
    

    reference :

    https://github.com/hamin/JASidePanels/commit/81ae7514d275d9242ad268ab818441c8d786a63e

    and

    https://github.com/gotosleep/JASidePanels/pull/164