zoukankan      html  css  js  c++  java
  • 电池栏上弹窗

    //可以不被电池栏挡住

    + (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];

    }

  • 相关阅读:
    js在html中的加载执行顺序
    外部JS的阻塞下载
    mysql 中文字段排序
    PHP 多维数组排序 array_multisort()
    最简单的Linux下apache+mysql+php安装
    [TJOI2008] 彩灯 (线性基)
    [洛谷P2257] YY的GCD (莫比乌斯反演)
    [SDOI2015] 约数个数和 (莫比乌斯反演)
    [POI2007] ZAP-Queries (莫比乌斯反演)
    [NOI2003] 文本编辑器 (splay)
  • 原文地址:https://www.cnblogs.com/ldc529/p/3874842.html
Copyright © 2011-2022 走看看