2013-10-29 56 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; }