• 电池栏上弹窗


    //可以不被电池栏挡住

    + (UILabel *)alertLabel

    {

        

        UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 20.f, 320.f, 0.f)];

        label.backgroundColor = [UIColor colorWithRed:240.f/255.f green:224.f/255.f blue:149.f/255.f alpha:1.0];

        label.textAlignment = NSTextAlignmentCenter;

        label.font = [UIFont systemFontOfSize:14];

        [[self alertWindow] addSubview:label];

        return label;

    }

    + (void)alertHeadMessage:(NSString *)message

    {

        CGFloat alertHeight = 30.f;

        __weak UIWindow *window = [self alertWindow];

        __weak UILabel *label = [self alertLabel];

        label.text = message;

        

        label.frame = CGRectMake(0, -30.f, window.frame.size.width, alertHeight);

        [UIView animateWithDuration:0.5f animations:^{

            label.frame = CGRectMake(0, 0.f, window.frame.size.width, alertHeight);

        } completion:^(BOOL finished) {

            [UIView animateWithDuration:2.5f animations:^{

                label.frame = CGRectMake(0, 0.f, window.frame.size.width, alertHeight + 2);

            } completion:^(BOOL finished) {

                [UIView animateWithDuration:0.4 animations:^{

                    label.frame = CGRectMake(0, -30.f, window.frame.size.width, alertHeight);

                } completion:^(BOOL finished) {

                    [label removeFromSuperview];

                }];

            }];

        }];

        [window makeKeyAndVisible];

    }

  • 相关阅读:
    博客推荐
    oracle11g dataguard 安装手册(转)
    Linux文件系统介绍(转)
    降低磁盘IO使Oracle性能优化(转)
    关于AWR报告命中率指标的解释(转)
    oracle 锁的介绍 (转)
    oracle undo redo 解析
    oracle sqlplus 连接不正常
    Oracle技术嘉年华
    断线的回忆
  • 原文地址:https://www.cnblogs.com/ldc529/p/3874842.html
Copyright © 2020-2023  润新知