[翻译] 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

 

 

目录
相关文章
|
2月前
|
人工智能 自然语言处理 数据可视化
比Sora更王炸,LTX Studio文本生成超25秒,视频自带背景音乐、转场等效果!
【2月更文挑战第13天】比Sora更王炸,LTX Studio文本生成超25秒,视频自带背景音乐、转场等效果!
76 3
比Sora更王炸,LTX Studio文本生成超25秒,视频自带背景音乐、转场等效果!
|
11月前
|
人工智能
【必备工具】兔哥视频助手,一键配音、字幕、配图,让你的视频秒变高大上!
通过输入文字,自动生成视频,让你的视频制作更加高效。
1001 0
|
开发工具 iOS开发 内存技术
iOS开发之多媒体播放
iOS开发之多媒体播放
124 0
|
人工智能 JavaScript 前端开发
教你怎样开发热门配音程序
欢迎来到我的小院,最近有个朋友说他看短视频老是听到一个男人的配音,有解说电影,讲知识的,他也知道这应该是AI配音出来的,但是就想知道从哪里来的,是否可以免费使用。于是在我历经千辛万苦的寻找下,很快找到了他想要的东西,肥水不流外人田,在这里我也给我的粉丝分享一下。
教你怎样开发热门配音程序
|
数据安全/隐私保护 Perl 开发工具