StretchScrollView 6.0.0

StretchScrollView 6.0.0

测试已测试
语言语言 SwiftSwift
许可证 MIT
发布上次发布2021年4月
SPM支持 SPM

Maintained by Anton Plebanovich.



  • By
  • Anton Plebanovich

StretchScrollView

Carthage compatible Version License Platform CI Status

StretchScrollView 提供了当向下滚动时放大标题图片并隐藏叠加图层的功能。向上滚动时,它允许动画化导航栏的背景。

示例

要运行示例项目,请首先克隆仓库,然后从 Example 目录中运行 pod install 命令。

GIF 动画

安装

Carthage

如果你在Storyboard中设置了StretchScrollView类,确保模块字段也是StretchScrollView

请查阅官方指南

Cartfile

github "APUtils/StretchScrollView" ~> 5.0

然后,将StretchScrollViewViewState框架添加到您的项目中。如果之前已存在,请移除APExtensionsViewState依赖。

CocoaPods

通过CocoaPods可以获取StretchScrollView。要安装它,只需将以下行添加到您的Podfile中

pod 'StretchScrollView', '~> 5.0'

配置

在Storyboard中将StretchScrollView类分配给您的UIScrollView,确保模块字段也是StretchScrollView

设置必要的出口和选项。

通常内容模式Aspect Fill适合UIImageView

stretchedView设置合适的约束。有两个缩放模式可用:通过顶部和高度约束以及通过顶部和两侧约束。

示例约束设置

对于第二种设置,如果滚动视图被放大,它将自动在中心缩放。

这同样适用于stretchedViewUIStackView内部并有高度约束的情况。

/// StretchScrollView will manage navigation bar transparency by itself.
/// You could disable this option to manage it by yourself or to disable navigation bar animations.
@IBInspectable var manageNavigationBarTransparency: Bool = true

/// In case of transparent navigation bar you may specify background color that will appear when you scroll up.
@IBInspectable var navigationBackgroundColor: UIColor = .clear

完成!请参阅示例项目以获取更多详细信息。

贡献

任何贡献都表示欢迎!您可以通过GitHub上的拉取请求和问题进行贡献。

作者

安东·普莱布诺维奇,[邮箱地址保护中]

许可证

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