zoukankan      html  css  js  c++  java
  • iOS 模态框覆盖导航栏

         1、使用window 覆盖

         2、试图添加到

         如果有一个场景:首页三个tab,要求只覆盖Navigation ,而不影响Tab使用,那么使用window 覆盖就不满足了。
         这里我们可以使用如下方案:

       
    业务调用
    ......
    [_loginView showInView:self.navigationController.view edgeInsets:UIEdgeInsetsMake(0, 0, bottom, 0) animation:animation];
    ......

      @implementation RPDLoginView  ( : UIView)


    -(void)showInView:(UIView*)supperView edgeInsets:(UIEdgeInsets)edgeInsets animation:(BOOL)animation{ [supperView addSubview:self]; [self makeConstraints:^(MASConstraintMaker *make) { make.edges.equalTo(supperView).with.insets(edgeInsets); }]; if (animation) { [_bottomView remakeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(self.mas_bottom); make.left.right.equalTo(self); make.height.equalTo(@180); }]; [self layoutIfNeeded];//如果其约束还没有生成的时候需要动画的话,就请先强制刷新后才写动画,否则所有没生成的约束会直接跑动画 [UIView animateWithDuration:0.3 animations:^{ [_bottomView remakeConstraints:^(MASConstraintMaker *make) { make.left.right.bottom.equalTo(self); make.height.equalTo(@180); }]; [self layoutIfNeeded];//强制绘制 }]; } }
  • 相关阅读:
    博客园博客
    mongo
    函数式编程与面向对象编程的对比
    python_字典dict要点总结
    pyhon_列表、元组要点总结
    vue-element框架通过blob进行后端token权限验证下载
    node-本地搭建服务
    (转载)测试用例标准
    soapUI学习笔记--用例字段参数化
    soapUI学习笔记---断言的小使用
  • 原文地址:https://www.cnblogs.com/kingbo/p/8342012.html
Copyright © 2011-2022 走看看