zoukankan      html  css  js  c++  java
  • 使用MDScratchImageView实现刮奖效果

    使用MDScratchImageView实现刮奖效果

    https://github.com/moqod/iOS-Scratch-n-See

    最终效果:

    其实这是使用了别人的东西而已:)

    源码:

    //
    //  RootViewController.m
    //  Scratch
    //
    //  Copyright (c) 2014年 Y.X. All rights reserved.
    //
    
    #import "RootViewController.h"
    #import "MDScratchImageView.h"
    #import "UIImage+ImageEffects.h"
    
    @interface RootViewController ()
    
    @end
    
    @implementation RootViewController
    
    - (void)viewDidLoad
    {
        [super viewDidLoad];
        self.view.backgroundColor = [UIColor blackColor];
        
        UIImage *image = [UIImage imageNamed:@"show"];
        
        // 背景图片
        UIImageView *blurImageView = 
            [[UIImageView alloc] initWithFrame:(CGRect){CGPointZero, image.size}];
        blurImageView.image        = image;
        blurImageView.center       = self.view.center;
        [self.view addSubview:blurImageView];
        
        // 被刮的图片
        MDScratchImageView *scratchImageView = 
            [[MDScratchImageView alloc] initWithFrame:(CGRect){CGPointZero, image.size}];
        [scratchImageView setImage:image
                            radius:10.f];
        scratchImageView.center             = self.view.center;
        [self.view addSubview:scratchImageView];
    }
    
    @end
  • 相关阅读:
    配置Keepalived双主热备
    配置 Keepalived
    Keepalived安装部署
    Keepalived配置Nginx自动重启
    Collectiont和Collections的区别
    HashMap和Hashtable的联系和区别
    Vector和ArrayList的联系和区别
    ArrayList和LinkedList 的联系和区别
    集合和数组的比较
    struts下载
  • 原文地址:https://www.cnblogs.com/YouXianMing/p/3783208.html
Copyright © 2011-2022 走看看