TLMotionEffect 重力感应

TLMotionEffect  重力感应

https://github.com/jvenegas/TLMotionEffect

This category adds a motion effect to your UIView. This is a similar effect can be seen in the background of the Home Screen on iOS 7.

Feel Free to complete this category with more motion effects. :)

The library has been tested on iOS 7.0+ for ARC environments.

这个category给你的UIView添加了重力感应效果。与你iOS7系统界面的背景图片移动效果类似哦。

欢迎你来完善这个category来实现更多的效果。

这个library已经在iOS7+上测试过,开了ARC哦。

 

Set up your Xcode project

  • Add into your project the following classes: 把以下两个文件添加到你的工程当中

    UIView+TLMotionEffect.h UIView+TLMotionEffect.m

  • Import the category and call the following method 引入这个category,并调用如下方法

    #import "UIView+TLMotionEffect.h"
    - (void)addCenterMotionEffectsXYWithOffset:(CGFloat)offset;
  • Example 例子
    UIView *myView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 100.0f, 100.0f)];
    [myView addCenterMotionEffectsXYWithOffset:40];

 

Test the catergory

You can run the tests in Xcode. Open TLMotion/TLMotionEffect.xcodeproj.

你可以在你的Xcode中进行测试。

 

Author

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值