简体   繁体   English

SwiftUI - 底部工作表有一个区域可以更改与内容接触的背景

[英]SwiftUI - the bottom sheet has an area which changes the background on contact with content

What i want我想要的是

There is a bottom sheet in the settings default app, in this bottom sheet there is a certain area with a button that changes the background when it comes into contact with content such as a NavigationBar or a TabView .设置默认应用程序中有一个底部工作表,在这个底部工作表中有一个带有按钮的特定区域,当它接触到NavigationBarTabViewcontent时,该按钮会更改background How can this be implemented?如何实施?

I tried putting a button in toolbar on the bottom bar, it worked fine and close to what I wanted, but the area is too small.我尝试在底部栏的工具栏中放置一个按钮,它工作正常并且接近我想要的,但是面积太小了。 I also tried .safeAreaInset with .bottomBar placement, but how to make the background change from what is above the content and disappear when there is no content below it like in video.我还尝试了.safeAreaInset.bottomBar放置,但是如何使backgroundcontent content消失。

It sounds like you are looking for a way to make the background opaque or blur it.听起来您正在寻找一种使背景不透明或模糊的方法。

The answers to this related question (the Opaque approach) may help you or you can try the answers for this question on how to Blur the background . 这个相关问题的答案(不透明方法)可能对你有帮助,或者你可以尝试这个问题的答案 how to Blur the background

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SwiftUI:用它拖动底部工作表的滚动视图 - SwiftUI: ScrollView that drags bottom sheet with it SwiftUI 列表顶部和底部的不同背景颜色 - SwiftUI Different background colors for the top and bottom of a List SwiftUI 列表重绘已提交工作表的内容 - SwiftUI List redraw the content of a presented sheet 忽略从 SwiftUI 呈现的 UIViewController 中的底部安全区域 - Ignore Bottom safe area in UIViewController presented from SwiftUI SwiftUI:如何将视图作为参数传递给另一个视图以获取底部工作表? - SwiftUI: How to pass a View as a parameter into another View to get Bottom Sheet? 给初学者的建议,让他们制作一个带有每天变化的标签的应用程序。 Xcode - Advice for beginner on making an app which has labels which content changes daily. Xcode SwiftUI 当 isPresented 值从闭包更改时不会关闭 - SwiftUI sheet not dismissing when isPresented value changes from a closure swiftUI contextMenu 具有不需要的模糊背景 - swiftUI contextMenu has unwanted blurred background 如何在UIScrollView中为内容区域设置背景颜色? - How to set background color to the content area in UIScrollView? SwiftUI:如何增加可以触发按钮的区域? - SwiftUI: How can I increase the area in which a button can be triggered?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM