PXPinnedRotation 0.1.3

PXPinnedRotation 0.1.3

测试已测试
Lang语言 Obj-CObjective C
许可 MIT
发布上次发布2015年8月

Daniel Blakemore维护。



  • 作者:
  • Daniel Blakemore

用法

PXPinnedRotation 允许您创建使用固定旋转的视图

Pinned Rotation

当手机旋转时,您的视图将保持原位,但会旋转,例如iOS中相机应用中的库和过滤器按钮。

使用 PXPinnedRotation 需要执行以下几步

  1. 继承 PXPinnedRotationViewPXPinnedRotationViewController
  2. 使用您的子视图(按钮、标签等)调用 [self addSubviewToAnimate:]
  3. 在 init 的末尾调用 [self manuallyStartLayoutPass]
  4. 实现 -(NSArray*)calculateBaseConstraintsBeforeLayoutPass 将所有代码放在此处,就像您通常会将代码放在 -(void)updateConstraints 中一样。

您指定的任何需要动画的视图都将进行动画处理。其他内容在旋转期间将保持不变。

如果您在旋转期间或之后需要额外的行为,可以在视图控制器上分配一些块。查看头文件以获取更多信息。

以上还有一个示例项目。要运行它,首先从 Git 仓库克隆,然后首先从 Example 目录中运行 pod install

安装

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

pod "PXPinnedRotation"

作者

Daniel Blakemore,[email protected]

许可

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