如果您有一幅竖直的照片,并想在 iPhone 横屏上展示,那么 YawImageViewer 就是您需要的!YawImageViewer 是一个视图,实现了类似 Facebook Paper 的图片浏览效果。展示这个视图后,用户只能看到照片的中心部分,通过倾斜移动,用户可以看到照片的其他部分。
要运行示例项目,克隆仓库,然后首先从 Example 目录运行 pod install
。
下载 pod 后,您可以将它添加到 ViewController 中,如下所示:
#import"KGTiltView.h"
@property (nonatomic, strong) KGTiltView* tiltView;
self.tiltView = [[KGTiltView alloc] initWithFrame:self.view.bounds image:[UIImage imageNamed:@"Image.jpg"]];
[self.tiltView setMotionEnabled:YES];
self.tiltView.yawTresholdLevel=[NSNumber numberWithDouble:0.07];
[self.view addSubview:self.tiltView];
iOS 8.0
YawImageViewer 可以通过 CocoaPods 使用。要安装它,只需将以下行添加到您的 Podfile 中:
pod "YawImageViewer"
KonraCLAPP, [email protected]
如果您需要在该 pod 中实现更多功能,请告诉我:)
YawImageViewer 采用 MIT 许可证。有关更多信息,请参阅 LICENSE 文件。