zoukankan      html  css  js  c++  java
  • 用UIInterpolatingMotionEffect产生透视效果

    用UIInterpolatingMotionEffect产生透视效果

    效果

    源码

    https://github.com/YouXianMing/Animations

    //
    //  MotionEffectViewController.m
    //  Animations
    //
    //  Created by YouXianMing on 16/2/18.
    //  Copyright © 2016年 YouXianMing. All rights reserved.
    //
    
    #import "MotionEffectViewController.h"
    #import "UIView+MotionEffect.h"
    #import "UIView+SetRect.h"
    
    @interface MotionEffectViewController ()
    
    @end
    
    @implementation MotionEffectViewController
    
    - (void)setup {
        
        [super setup];
        
        {
            UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, Width - 15, Width - 15)];
            imageView.image        = [UIImage imageNamed:@"最外层"];
            imageView.center       = self.contentView.middlePoint;
            [self.contentView addSubview:imageView];
            
            [imageView addCenterMotionEffectsWithOffset:20.f];
        }
        
        {
            UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, Width - 15, Width - 15)];
            imageView.image        = [UIImage imageNamed:@"中间层"];
            imageView.center       = self.contentView.middlePoint;
            [self.contentView addSubview:imageView];
            
            [imageView addCenterMotionEffectsWithOffset:10.f];
        }
        
        {
            UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, Width - 15, Width - 15)];
            imageView.image        = [UIImage imageNamed:@"最里层"];
            imageView.center       = self.contentView.middlePoint;
            [self.contentView addSubview:imageView];
            
            [imageView addCenterMotionEffectsWithOffset:5.f];
        }
    }
    
    @end

    细节

  • 相关阅读:
    laravel md5+salt 密码
    sql语句 当前时间查找重复 时间戳转换
    Supesite 参数说明
    ajax
    PDO操作
    laravel paginate动态分页
    PHP iconv()函数转字符编码的问题(转)
    计算几何基础模板(2014.10.6一直沿用)
    hdu 4893
    2014 ACM/ICPC 鞍山赛区网络赛(清华命题)
  • 原文地址:https://www.cnblogs.com/YouXianMing/p/5204515.html
Copyright © 2011-2022 走看看