2013-10-29 66 views
4

我在我的应用程序中使用JASidePanels,一切都非常好。我的设计团队想出了一个UI设计就是这样,当侧板显示或显示,iOS JASidePanel状态栏定制

enter image description here

但是我能够重现就好!这个。

enter image description here

什么都我迄今为止尝试:

我尝试设置中心面板背景颜色,我在右侧面板中的形象 - 没有运气。

我尝试设置sidePanel.view.backgroundColor和tintColor - 没有运气。

任何帮助表示赞赏!

回答

3

这JASidePanels的错误,但是他们解决了该问题通过这样做:在JASidePanelsController 添加以下代码_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; 
        } 

     } 
... 
} 

而且在_layoutSideContainers加:

- (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; 
         } 
      } 

    ... 
} 

参考:

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

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

1

我尝试了一个基于JASidePanels的演示源代码的简单测试。并得到了这样的效果:

screenshot

如果这不是你想要的,请忽略这个答案,并删除它。


它通过修改JASidePanels的源代码:

为了测试,我添加 self.window.backgroundColor = [UIColor redColor]

在您的情况,您可以添加[self.window addSubview:backgroundImageView]jaSidePanelController.view addSubview:backgroundImageView(请自行测试这个)

然后通过添加额外的空间来让左侧面板不会覆盖您的背景图像视图以调整左侧面板的框架的大小土耳其酒吧。在JASidePanelController#_layoutSidePanels

PS:了解更多详情,您应该阅读有关类似http://www.doubleencore.com/2013/09/developers-guide-to-the-ios-7-status-bar/

的iOS 7状态栏的文章顺便说一句:我很好奇,有在你的截图没有cornerRadius

+0

我将拐角设置为0,因为拐角半径对我来说不是真正平坦的UI。为此在JASlidePanelController中查找: - (void)stylePanel:(UIView *)panel {} {panel.layer.cornerRadius = 0.0f; // Here panel.clipsToBounds = YES; } – Maziyar

0

只需设置cornerRadius 0.0F的JASlidePanelController。m文件:

- (void)stylePanel:(UIView *)panel { 
     //do changes in below cornerRadius 
     panel.layer.cornerRadius = 0.0f; 
     panel.clipsToBounds = YES; }