zoukankan      html  css  js  c++  java
  • 动态 改变导航栏透明度

    #pragma mark - 实现代理方法  UINavigationBarDelegate 改变导航栏的颜色等功能

    - (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated

    {

        self.navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;

        UIImage *image = [UIImage imageNamed:@"128"];

        [self.navigationController.navigationBar setBackgroundImage:image forBarMetrics:UIBarMetricsDefault];

        UIView *view = self.navigationController.navigationBar.subviews[0];

        

        if (_tableView.contentOffset.y <= - 64) {

            

            self.navigationController.navigationBar.translucent = YES;

            view.alpha = 0;

        } else if(_tableView.contentOffset.y > - 64 && _tableView.contentOffset.y <= 0) {

        

            self.navigationController.navigationBar.translucent = YES;

                view.alpha = (64 - fabs(_tableView.contentOffset.y)) / 200.0f;//绝对值

        } else {

            

            view.alpha = (_tableView.contentOffset.y + 128) / 200.0f;

            if (view.alpha >= 1) {

                self.navigationController.navigationBar.translucent = NO;

            }

            

        }

        DLog(@"%f", _tableView.contentOffset.y);

        

    }

  • 相关阅读:
    3.5.3 数据排序;重复数值、缺失值处理
    3.5.1 pandas基础
    3.3 numpy
    数据准备和特征工程
    2.4函数
    2.3语句与控制流
    2.2数据结构与序列
    2.1Python基础知识
    五、MySQL安装
    四、Hadoop HA 集群搭建
  • 原文地址:https://www.cnblogs.com/iOS-mt/p/4251479.html
Copyright © 2011-2022 走看看