gpt4 book ai didi

ios - 接听电话时 AMSlideMenu UI 困惑(通话中状态栏)

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:00:56 25 4
gpt4 key购买 nike

图书馆:https://github.com/SocialObjects-Software/AMSlideMenu

问题:当你处于关闭菜单状态并在结束通话后或在通话中尝试打开滑动菜单时接到电话(只需在iOS模拟器中模拟),如果你尝试打开滑动菜单,菜单会显得有点小。

对此有更好的解决方法吗?

最佳答案

快速解决方法,

  1. 转到 AMSlideMenuMainViewController.m
  2. 替换文件中的以下方法,
- (void)openRightMenu
{
CGRect frame = self.rightMenu.view.frame;
frame.origin.x = [UIScreen mainScreen].bounds.size.width - [self rightMenuWidth];
frame.origin.y = 0;
frame.size = [UIScreen mainScreen].bounds.size;
frame.size.width = [self rightMenuWidth];
self.rightMenu.view.frame = frame;
[self openRightMenuAnimated:YES];
}
- (void)openLeftMenu
{
CGRect frame = self.leftMenu.view.frame;
frame.origin.x = 0;
frame.origin.y = 0;
frame.size = [UIScreen mainScreen].bounds.size;
self.leftMenu.view.frame = frame;
[self openLeftMenuAnimated:YES];
}

还有这个,

- (void)configure3DTransformForMenu:(AMSlideMenu)menu panningView:(UIView *)panningView
{
float cx = 0;
float cy = 0;
float cz = 0;
float opacity = 0;

/********************************************* DEEPNESS EFFECT *******************************************************/
if (menu == AMSlideMenuLeft && panningView.frame.origin.x != 0 && [self deepnessForLeftMenu])
{
//Workaround for in-call status bar
CGRect frame = self.leftMenu.view.frame;
frame.origin.x = 0;
frame.origin.y = 0;
frame.size = [UIScreen mainScreen].bounds.size;
self.leftMenu.view.frame = frame;
//end workaround for in-call status bar

cx = kMenuTransformScale.m11 + (panningView.frame.origin.x / [self leftMenuWidth]) * (1.0 - kMenuTransformScale.m11);
cy = kMenuTransformScale.m22 + (panningView.frame.origin.x / [self leftMenuWidth]) * (1.0 - kMenuTransformScale.m22);
cz = kMenuTransformScale.m33 + (panningView.frame.origin.x / [self leftMenuWidth]) * (1.0 - kMenuTransformScale.m33);

opacity = kMenuLayerInitialOpacity + (panningView.frame.origin.x / [self leftMenuWidth]) * (1.0 - kMenuLayerInitialOpacity);

self.leftMenu.view.layer.transform = CATransform3DMakeScale(cx, cy, cz);
self.leftMenu.view.layer.opacity = opacity;
}
else if (menu == AMSlideMenuRight && panningView.frame.origin.x != 0 && [self deepnessForRightMenu])
{
//Workaround for in-call status bar
CGRect frame = self.rightMenu.view.frame;
frame.origin.x = [UIScreen mainScreen].bounds.size.width - [self rightMenuWidth];
frame.origin.y = 0;
frame.size = [UIScreen mainScreen].bounds.size;
frame.size.width = [self rightMenuWidth];
self.rightMenu.view.frame = frame;
//end workaround for in-call status bar

cx = kMenuTransformScale.m11 + (-panningView.frame.origin.x / [self rightMenuWidth]) * (1.0 - kMenuTransformScale.m11);
cy = kMenuTransformScale.m22 + (-panningView.frame.origin.x / [self rightMenuWidth]) * (1.0 - kMenuTransformScale.m22);
cz = kMenuTransformScale.m33 + (-panningView.frame.origin.x / [self rightMenuWidth]) * (1.0 - kMenuTransformScale.m33);

opacity = kMenuLayerInitialOpacity + (-panningView.frame.origin.x / [self rightMenuWidth]) * (1.0 - kMenuLayerInitialOpacity);

self.rightMenu.view.layer.transform = CATransform3DMakeScale(cx, cy, cz);
self.rightMenu.view.layer.opacity = opacity;
}
/********************************************* DEEPNESS EFFECT *******************************************************/

/********************************************* STATUS BAR FIX *******************************************************/
if (menu == AMSlideMenuLeft && panningView.frame.origin.x != 0)
{
if (self.statusBarView)
{
self.statusBarView.layer.opacity = 1 - panningView.frame.origin.x / [self leftMenuWidth];
}
}
else if (menu == AMSlideMenuRight && panningView.frame.origin.x != 0)
{
if (self.statusBarView)
{
self.statusBarView.layer.opacity = 1 - abs(panningView.frame.origin.x) / [self rightMenuWidth];
}
}
/********************************************* STATUS BAR FIX *******************************************************/

/********************************************* DARKNESS EFFECT *******************************************************/
if (menu == AMSlideMenuLeft)
{
CGFloat alpha = [self maxDarknessWhileLeftMenu] * (panningView.frame.origin.x / [self leftMenuWidth]);

self.darknessView.alpha = alpha;
}
else if(menu == AMSlideMenuRight)
{
CGFloat alpha = [self maxDarknessWhileRightMenu] * (abs(panningView.frame.origin.x) / [self rightMenuWidth]);

self.darknessView.alpha = alpha;
}
/********************************************* DARKNESS EFFECT *******************************************************/
}

关于ios - 接听电话时 AMSlideMenu UI 困惑(通话中状态栏),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23386944/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com