我正在使用 JASidePanels在我的应用程序中,到目前为止一切都很好。我的设计团队提出了这样的 UI 设计,当显示或显示侧面板时,
但我能够重现!这个。
到目前为止我都尝试了什么:
我尝试将中央面板的背景颜色设置为右侧面板中的图像 - 运气不好。
我尝试设置 sidePanel.view.backgroundColor 和 tintColor - 运气不好。
感谢任何帮助!
最佳答案
这是 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
和
关于iOS JASidePanel 状态栏自定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19656543/