iOS JASidePanel状态栏自定义 [英] iOS JASidePanel status bar customization

查看:140
本文介绍了iOS JASidePanel状态栏自定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用中使用





< a href =https://github.com/gotosleep/JASidePanels/pull/164\"rel =nofollow> https://github.com/gotosleep/JASidePanels/pull/164


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,

But I am able to reproduce like! this.

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!

解决方案

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

这篇关于iOS JASidePanel状态栏自定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆