MXParallaxBackground 1.0.0

MXParallaxBackground 1.0.0

测试已测试
语言语言 Obj-CObjective C
许可 MIT
发布最新发布2019年8月

Maxime Epain 维护。



MXParallaxBackground

CI Status Version Carthage compatible License Platform

MXParallaxBackground 是一个简单的 UIScrolView 背景类。

水平 垂直
Demo Demo

使用

如果您想尝试它,只需运行

pod try MXParallaxBackground

或者克隆仓库,然后从 Example 目录运行 `pod install`。

  • 向 UIScrollView 添加视差背景非常简单,例如
Swift
let imageView = UIImageView()
imageView.contentMode = .scaleAspectFill
imageView.image = UIImage(named: "Background")

let background = MXParallaxBackground()
background.view = imageView
background.intensity = 0.75

let scrollView = UIScrollView()
scrollView.add(background)
Objective-C
UIImageView *imageView = [UIImageView new];
imageView.contentMode = UIViewContentModeScaleAspectFill;
imageView.image = [UIImage imageNamed:@"Background"];
    
MXParallaxBackground *background = [MXParallaxBackground new];
background.view = imageView;
background.intensity = 0.75;

UIScrollView *scrollView = [UIScrollView new]; 
[scrollView addBackground:background];

安装

MXParallaxBackground 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中。

pod "MXParallaxBackground"

作者

Maxime Epain

Twitter

致谢

图像摘自 这篇教程,由 Jonathan Nicol 提供。

许可证

MXParallaxBackground 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。