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

    细节

  • 相关阅读:
    JSTL标签用法
    (转)javascript正则实战
    Spring中几种数据源的配置
    (转)常用正则表达式
    EL表达式详解
    JAVA环境变量配置(转)
    S2SH整合步骤
    正则表达式30分钟教程(转)
    在Flash Player 10.2中使用原生鼠标指针
    time
  • 原文地址:https://www.cnblogs.com/YouXianMing/p/5204515.html
Copyright © 2011-2022 走看看