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 }
  • 相关阅读:
    PL/SQL快捷键
    <c:if>条件判断 和 取值做乘法运算
    文档保存后找不到了误以为丢失,重做!
    Gson将参数放入实体类中进行包装之后再传递
    [leedcode 66] Plus One
    [leedcode 65] Valid Number
    [leedcode 64] Minimum Path Sum
    [leedcode 63] Unique Paths II
    [leedcode 62] Unique Paths
    [leedcode 61] Rotate List
  • 原文地址:https://www.cnblogs.com/jisa/p/6843869.html
Copyright © 2011-2022 走看看