Code Monkey home page Code Monkey logo

yqmotionshadowview's Introduction

YQMotionShadowView

微博:畸形滴小男孩

视差阴影效果 - 根据手机的移动,改变阴影的位置

效果预览:

image image

  • 实际显示效果比截图展示效果要好,偏移手机,阴影位置会跟着偏移

-直接拖到工程中使用

#import "YQMotionShadowView.h"

Example Code:

最简单使用(默认效果):

	
	//对于任意一个需要加阴影的View,比如这里有个ImageView;
	UIImageView *IMGV;

	//生成一个阴影View
	YQMotionShadowView *showView = [YQMotionShadowView fromView:IMGV];

	//将阴影view显示,原View不需要再显示了
    [self.view addSubview:showView];

自定义参数:

	
	//阴影颜色、透明度、模糊程度,就按Layer的方法去设置即可
    showView.shadowColor   = [UIColor darkGrayColor].CGColor;
    showView.shadowOpacity = 0.8;
    showView.shadowRadius  = 20;

    //视差View相关设置 -- 可以自己调节参数,对效果进行调整

    //允许的阴影偏移量 - 默认30
    showView.offset = 30//阴影移动速度 - 默认0.3
    showView.speedLevel = 0.3//往中间恢复的速度 - 默认80
    showView.backSpeed = 80

yqmotionshadowview's People

Contributors

976431yang avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.