美文网首页
显示微博刷新数

显示微博刷新数

作者: 白雪天枫 | 来源:发表于2018-02-03 22:40 被阅读9次

//显示微博刷新数

-(void)showStatusCount:(int)count {

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

    label.backgroundColor = [UIColor grayColor];

    label.textAlignment = NSTextAlignmentCenter;

    label.textColor = [UIColor whiteColor];

    label.font = [UIFont systemFontOfSize:16];

    label.width = [UIScreen mainScreen].bounds.size.width;

    label.height = 35;

    label.y = 64 - label.height;

    if (count) {

        label.text = [NSString stringWithFormat:@"有%d条微博更新了",count];

    }else{

        label.text = @"没有新的微博";

    }

    [self.view addSubview:label];

    //添加label

    //    [self.navigationController.view insertSubview:label belowSubview:self.navigationController.navigationBar];

    //出来的动画

    [UIView animateWithDuration:0.5 animations:^{

        label.transform = CGAffineTransformMakeTranslation(0, label.height);

    } completion:^(BOOL finished) {

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

            label.transform = CGAffineTransformIdentity;

        } completion:^(BOOL finished) {

            [label removeFromSuperview];

        }];

    }];

}

相关文章

网友评论

      本文标题:显示微博刷新数

      本文链接:https://www.haomeiwen.com/subject/idepzxtx.html