swiftui
If you’ve been around smart phones long enough, you may remeber iOS 7. It was a huge update to the iPhone, bringing in not only a tone of new features and functionality, but also a fresh new design. This update to iOS was nothing less than a full-fledged overhaul of the operating system’s look and feel.
如果您使用智能手机的时间已经足够长了,您可能会考虑使用iOS7。这是对iPhone的巨大更新,不仅带来了新功能和新功能,而且还带来了全新的设计。 对iOS的此次更新无非是对操作系统外观的全面革新。
One of the more interesting changes was the presence of semi-translucent toolbars and backgrounds like Control Center. That effect of “blurred” sort of “frosted-glass” background which is just transparent enough to be able to tell that there is something behind it. It’s so nice to look at 😍
最有趣的更改之一是半透明的工具栏和诸如Control Center的背景。 这种“模糊的”“磨砂玻璃”背景的效果是足够透明的,足以分辨出背后有东西。 看😍真好
These days there is a very straightforward way to achieve the blur effect by means of UIVisualEffectView
.
UIVisualEffectView
有一种非常简单的方法可以通过UIVisualEffectView
实现模糊效果。
You can tell right away that this comes from UIKit
which means there are probably a few tweaks needed in order to use it in SwiftUI.
您可以马上说出它来自UIKit
,这意味着可能需要一些调整才能在SwiftUI中使用它。
Let’s get started!
让我们开始吧!
创建BlurView (Creating the BlurView)
When we need UIK