MIT License

项目介绍

nerdsupremacist/FancyScrollView 是一个托管在 GitHub 上的开源项目,主要使用 Swift 编写,采用 MIT License 许可证,目前获得 1.0k 个 Star、52 次 Fork。

仓库全名
nerdsupremacist/FancyScrollView
开源许可证
MIT License
Star 数
1.0k
Fork 数
52
未关闭 Issue
7

README 摘要

FancyScrollView I spent a lot of time looking for a way to recreate the UI of the ScrollViews in Stock Apple Apps (i.e. App Store and Apple Music) inside of SwiftUI. And here is the result! I call it FancyScrollView. It's a ScrollView with a few extra perks: Fancy Blur when scrolling Use a FancyScrollView instead of a normal ScrollView and it will add a nice blur in the safe area. Making your View look much cleaner…

完整内容见 GitHub 原始 README 或本页 。

常见问题

FancyScrollView 用什么语言开发?

主要使用 Swift 编写,采用 MIT License 许可证,目前有 1.0k 个 Star。

FancyScrollView 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 FancyScrollView 的源码?

可以直接克隆仓库:git clone https://github.com/nerdsupremacist/FancyScrollView.git,默认分支为 develop;安装与运行步骤见仓库 README。

FancyScrollView 最近还在维护吗?

仓库最近一次更新为 2021年10月29日,当前有 7 个未关闭 Issue;Star 数为 1.0k,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

A SwiftUI ScrollView Designed to imitate the App Store and Apple Music ScrollViews (with or without a Parallax Header)

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
1135
价值分
629
活跃状态
活跃

语言占比

Swift

Release

README

FancyScrollView

I spent a lot of time looking for a way to recreate the UI of the ScrollViews in Stock Apple Apps (i.e. App Store and Apple Music) inside of SwiftUI.

And here is the result! I call it FancyScrollView. It’s a ScrollView with a few extra perks:

Fancy Blur when scrolling

Use a FancyScrollView instead of a normal ScrollView and it will add a nice blur in the safe area. Making your View look much cleaner while scrolling!

FancyScrollView {
	VStack {
		...
	}
}

Result:

Including a Header

I was really surprised by the fact I couldn’t find a proper Package for adding a nice Parallax header to a ScrollView. So I included it here! And you can customize everything about it:

Scrolling Up Behavior:

You can specify one of two behaviors:

public enum ScrollUpHeaderBehavior {
    case parallax // Will zoom out all pretty ;)
    case sticky // Will stay at the top
}

Scrolling Down Behavior:

public enum ScrollDownHeaderBehavior {
    case offset // Will move the header with the content
    case sticky // Will stay at the top and the content will cover the header
}

Let’s see them in action!

Here’s every combination between scrolling behaviors

Parallax + Offset (Default):

This is the default and appears to be the most neutral and standard version of the ScrollView Header in the Market. Chances are, you want this one!

FancyScrollView(title: "The Weeknd",
                headerHeight: 350,
                scrollUpHeaderBehavior: .parallax,
                scrollDownHeaderBehavior: .offset,
                header: { Image(...).resizable().aspectRatio(contentMode: .fill) }) {
	...
}

Result:

Parallax + Sticky:

This combination is designed to imitate the header from the Artist Detail View in Apple Music.

FancyScrollView(title: "The Weeknd",
                headerHeight: 350,
                scrollUpHeaderBehavior: .parallax,
                scrollDownHeaderBehavior: .sticky,
                header: { Image(...).resizable().aspectRatio(contentMode: .fill) }) {
	...
}

Result:

Sticky + Offset:

This combination is designed to imitate the header from the “Today” showcases in the App Store.

FancyScrollView(title: "The Weeknd",
                headerHeight: 350,
                scrollUpHeaderBehavior: .sticky,
                scrollDownHeaderBehavior: .offset,
                header: { Image(...).resizable().aspectRatio(contentMode: .fill) }) {
	...
}

Result:

Sticky + Sticky:

I’m not sure who’s looking for this behavior, but it looks cool. So, you do you!

FancyScrollView(title: "The Weeknd",
                headerHeight: 350,
                scrollUpHeaderBehavior: .sticky,
                scrollDownHeaderBehavior: .sticky,
                header: { Image(...).resizable().aspectRatio(contentMode: .fill) }) {
	...
}

Result:

Known Issues

  • The pop back navigation bar gesture is broken in these.
    • Sorry, but I couldn’t find a proper way to get access to the Gesture Recognizer without the ScrollView being the first screen in a NavigationView
  • The back button always appears when you have a header (Only use it for details or modals)
    • I didn’t find a way to know whether there’s a screen to go back to
  • On light mode with a header the Status Bar doesn’t look great. Didn’t find a way to change it to white.

评论

暂无评论