|
|
|
import AnimatedGradient
struct ContentView: View {
var body: some View {
AnimatedLinearGradient(colors: [.red, .green, .blue])
}
}
import AnimatedGradient
struct ContentView: View {
var body: some View {
AnimatedLinearGradient(colors: [.red, .green, .blue])
.numberOfSimultaneousColors(2)
.setAnimation(.linear(duration: 5))
.gradientPoints(start: .bottomLeading, end: .topTrailing)
}
}
colors
- 渐变将过渡的颜色数组numberOfSimultaneousColors(Int)
- 屏幕上任何给定时间显示的颜色数量,可以大于、等于或小于数组中的颜色数setAnimation(Animation)
- 一种颜色过渡到另一种颜色的动画gradientPoints(start:end:)
- 标准线性渐变控制点您可以从 GradientPreset 使用预选颜色以快速入门
要尝试 AnimatedGradient 示例
https://github.com/exyte/AnimatedGradient.git
Example.xcodeproj
dependencies: [
.package(url: "https://github.com/exyte/AnimatedGradient.git")
]
PopupView - Toasts 和 popups 库
Grid - 最强大的 Grid 容器
ScalingHeaderScrollView - 带有粘性标题的滚动视图,滚动时标题会缩小
AnimatedTabBar - 具有多种预设动画的选项卡栏
MediaPicker - 可自定义的媒体选择器
Chat - 具有完全可定制的消息单元格、输入视图和内置媒体选择器的 Chat UI 框架
OpenAI 用于 OpenAI REST API 的包装库
ConcentricOnboarding - 动画引导流程
FloatingButton - 浮动按钮菜单
ActivityIndicatorView - 许多动画加载指示器
ProgressIndicatorView - 许多动画进度指示器
FlagAndCountryCode - 每个国家/地区的电话代码和标志
SVGView - SVG 解析器
LiquidSwipe - 流体导航动画