l***@163.com
l***@163.com
  • 发布:2021-03-22 18:37
  • 更新:2021-03-25 11:17
  • 阅读:612

【报Bug】离线打包nvue页面原生导航栏隐藏bug

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: 11.2.2 (20D80)

HBuilderX类型: 正式

HBuilderX版本号: 3.1.2

手机系统: iOS

手机系统版本号: IOS 14

手机厂商: 苹果

手机机型: iPhone 11

页面类型: nvue

打包方式: 离线

项目创建方式: HBuilderX

App下载地址或H5⽹址: http://d.firim.top/2daj

操作步骤:

扩展-》设置中心-》左上角返回-》导航栏无法自动隐藏-》点击离线中心手动隐藏-》nvue页面布局出现错误

预期结果:

nvue页面(图1)pushViewController 跳转iOS原生页面(图2),返回后导航栏正常隐藏

实际结果:

图3图4导航栏出现bug

bug描述:

nvue页面pushViewController 跳转iOS原生页面,返回后导航栏无法隐藏

2021-03-22 18:37 负责人:无 分享
已邀请:
l***@163.com

l***@163.com (作者) - LTY2009

解决方案:

在原生工程ViewController.m中修改(同时解决右滑返回问题):

  • (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:YES animated:YES];
    }

  • (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
    self.navigationController.interactivePopGestureRecognizer.delegate = nil;
    self.navigationController.interactivePopGestureRecognizer.enabled = NO;
    }
    }

  • (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    self.navigationController.interactivePopGestureRecognizer.delegate = (id)self;
    self.navigationController.interactivePopGestureRecognizer.enabled = YES;
    }

该问题目前已经被锁定, 无法添加新回复