zoukankan      html  css  js  c++  java
  • UIVisualEffectView(高斯模糊效果)

       ///高斯模糊。
       UIView *tempView = [[UIView alloc] initWithFrame:CGRectMake(100, 100, 100, 100)]; tempView.backgroundColor = [UIColor yellowColor]; [self.view addSubview:tempView]; ///UIBlurEffectStyleExtraLight聚光灯效果。UIBlurEffectStyleLight效果轻。UIBlurEffectStyleDark效果重。 UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; UIVisualEffectView *effectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect]; effectView.frame = CGRectMake(100, 100, 100, 100); ///作用对tempView做高斯模糊效果。 [self.view addSubview:effectView];

    将UIBackgroundTaskIdentifier设置为UIBackgroundTaskInvalid即后台任务已关闭。

     1 - (void)applicationDidEnterBackground:(UIApplication *)application {
     2     //由于要取消后台任务,所以需要后台任务标识符 。
     3     _identifier = [application beginBackgroundTaskWithExpirationHandler:^{
     4           [self endTask]; // 如果在系统规定时间内任务还没有完成,在时间到之前会调用到这个方法,一般是10分钟
     5     }];
     6     
     7     [self performSelector:@selector(endTask) withObject:self afterDelay:120];
     8 }
     9 
    10 - (void)endTask{
    11     [[UIApplication sharedApplication] endBackgroundTask:_identifier];
    12     _identifier = UIBackgroundTaskInvalid;
    13 }
  • 相关阅读:
    工具类官网Web原型制作分享-Adobe
    还在为黑白网页设计犯难?12款设计帮你轻松解决!!!
    联系我们吧
    单调栈&&单调队列
    *模板--数据结构
    非递归线段树专题
    反素数
    线段树专题训练
    BST
    排列与组合
  • 原文地址:https://www.cnblogs.com/jisa/p/6843869.html
Copyright © 2011-2022 走看看