CRCutoutView 1.0.1

CRCutoutView 1.0.1

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最新版本2014年12月

Christian Roman 维护。



这是一个基于 Facebook Slingshot 应用启发的像素动画的自定义 UIView 子类。

安装

有两种选择

CocoaPods

  • 将依赖性添加到您的 Podfile 中
platform :ios
pod 'CRPixellatedView'
...
  • 运行 pod install 以安装依赖项。

源文件

  • 只需克隆此存储库或以 zip 文件的形式下载它。
  • 然后您将在 CRCutoutView 目录下找到源文件。
  • 将它们复制到您的项目中。

使用方法

要使用 CRCutoutView,创建一个 CRCutoutView,配置并动画化!

CRCutoutView 制作示例

CRPixellatedView *pixellatedView = [[CRPixellatedView alloc] initWithFrame:CGRectMake(0, 0, 320, 320)];
pixellatedView.image = [UIImage imageNamed:@"Image"];
[self.view addSubview:pixellatedView]; // Add to your view
[pixellatedView animate];

您可以配置此可定制的示例设置

CRPixellatedView *pixellatedView = [[CRPixellatedView alloc] initWithFrame:CGRectMake(0, 0, 320, 320)];
pixellatedView.image = [UIImage imageNamed:@"Image"];
pixellatedView.pixelScale = 20.0f;
pixellatedView.animationDuration = 0.8f;
[self.view addSubview:pixellatedView]; // Add to your view
[pixellatedView animateWithCompletion:^(BOOL finished) {
    NSLog(@"completed");
}];

此外,您还可以通过使用 reverse 属性自定义动画效果

CRPixellatedView *pixellatedView = [[CRPixellatedView alloc] initWithFrame:CGRectMake(0, 0, 320, 320)];
pixellatedView.image = [UIImage imageNamed:@"Image"];
pixellatedView.pixelScale = 20.0f;
pixellatedView.animationDuration = 0.8f;
pixellatedView.reverse = YES; // Reverse effect
[self.view addSubview:pixellatedView]; // Add to your view
[pixellatedView animateWithCompletion:^(BOOL finished) {
    NSLog(@"completed");
}];

示例

pixellatedView.reverse = YES; // Reverse effect

CRPixellatedView-demo1

CRPixellatedView-demo2

pixellatedView.reverse = NO; // (default)
pixellatedView.pixelScale = 30.0f;

CRPixellatedView-demo3

演示

请参阅 CRPixelledViewDemo Xcode 项目。

要求

  • iOS 6.0 或更高版本的 Objective-C。

问题

  • 仅与正方形图像一起出色工作 :(

贡献

欢迎任何想要为项目贡献力量的人。

  • 将此存储库分支
  • 进行您的更改
  • 提交拉取请求

许可证

CRCutoutView 在 MIT 许可下发布。请参阅 LICENSE

联系方式

Christian Roman

http://chroman.me

[email protected]

@chroman