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];//强制绘制 }]; } }
  • 相关阅读:
    关于“每日代码系列”以及后续计划
    每日代码系列(22)
    每日代码系列(21)
    mvcc
    父进程是1号进程产生大量的僵尸进程的解决方案
    nginx学习之路
    Zookeeper Curator 分布式锁
    jvm垃圾收集器汇总
    MySql分库分表以及相关问题
    Https交互原理
  • 原文地址:https://www.cnblogs.com/kingbo/p/8342012.html
Copyright © 2011-2022 走看看