zoukankan      html  css  js  c++  java
  • iOS之用uilabel弹出消息提示框

    UILabel *cover = [[UILabel alloc] init];

        cover.frame = CGRectMake(0, 0, 150, 30);

        cover.center = CGPointMake(self.view.frame.size.width * 0.5, self.view.frame.size.height * 0.5);

        cover.font = [UIFont systemFontOfSize:12];

        cover.text = [NSString stringWithFormat:@"成功安装%@", app.name];

        cover.textColor = [UIColor whiteColor];

        cover.textAlignment = NSTextAlignmentCenter;

        cover.backgroundColor = [UIColor blackColor];

        cover.alpha = 0.0;

        cover.clipsToBounds = YES;

        cover.layer.cornerRadius = 5;

        [self.view addSubview:cover];

        

        [UIView animateWithDuration:0.5 animations:^{

            cover.alpha = 0.5;

        } completion:^(BOOL finished) {

            [UIView animateWithDuration:0.5 delay:0.5 options:UIViewAnimationOptionCurveEaseInOut animations:^{

                cover.alpha = 0.0;

            } completion:^(BOOL finished) {

                [cover removeFromSuperview];

            }];

        }];

  • 相关阅读:
    48. Rotate Image
    47. Permutations II
    46. Permutations
    45. Jump Game II
    44. Wildcard Matching
    43. Multiply Strings
    42. Trapping Rain Water
    41. First Missing Positive
    40. Combination Sum II
    39. Combination Sum
  • 原文地址:https://www.cnblogs.com/changxs/p/4045957.html
Copyright © 2011-2022 走看看