黑暗模式和洛蒂动画
我正在使用Lottie在我的应用程序中的着陆页上显示徽标动画。
我用白色背景和黑色背景制作了动画。根据黑暗模式的状态,我想展示白色或黑色。
到目前为止的代码(正常运行):
var body: some View {
VStack {
TabView(selection: $selection) {
VStack(spacing: 0) {
Spacer()
Text("Title")
.font(.largeTitle)
Rectangle()
.fill(Color.secondary.opacity(0.2))
.frame(height: 1)
VStack(alignment: .leading) {
LottieView(name: "logowhite")
.scaledToFit()
.padding(60)
Text("Detail")
Text("")
HStack() {
Spacer()
Text("Copyright")
Spacer()
}
}.padding()
Spacer()
}
}
我可以测试是否打开黑模式,然后显示“ loglakback”而不是“ logowhite”?
I'm using Lottie to display a logo animation on a landing page in my app.
I made that animation with a white background and also with a black background. Depening on the state of dark mode I want to show the white or the black one.
The code so far (that works fine):
var body: some View {
VStack {
TabView(selection: $selection) {
VStack(spacing: 0) {
Spacer()
Text("Title")
.font(.largeTitle)
Rectangle()
.fill(Color.secondary.opacity(0.2))
.frame(height: 1)
VStack(alignment: .leading) {
LottieView(name: "logowhite")
.scaledToFit()
.padding(60)
Text("Detail")
Text("")
HStack() {
Spacer()
Text("Copyright")
Spacer()
}
}.padding()
Spacer()
}
}
Can I test if dark mode is on, and then display 'logoblack' instead of 'logowhite'?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)