The iOS 14 battery widget has blur.
But if you implement them yourself in WidgetKit, you'll get 🚫 on a yellow background.
How should I implement it?
struct VisualEffectView: UIViewRepresentable {
var effect: UIVisualEffect?
func makeUIView(context: UIViewRepresentableContext<Self>) -> UIVisualEffectView { UIVisualEffectView() }
func updateUIView(_ uiView: UIVisualEffectView, context: UIViewRepresentableContext<Self>) { uiView.effect = effect }
}
struct BackgroundSunView : View {
var body: some View {
VisualEffectView(effect: UIBlurEffect(style: .dark))
.edgesIgnoringSafeArea(.all)
}
}
struct WidgetKitEntryView : View {
var body: some View {
ZStack {
BackgroundSunView()
VStack {
Text("Hello")
}
}
}
}
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I want to drag and drop is AR.How can I drag and drop 3D data with RealityKit and Reality Composer?
Hello. I want to use an icon created with Icon Composer to change the app icon in my iOS 26 app.
UIApplication.shared.setAlternateIconName("AppIcon")
This code works with the icon included in Assets.xcassets (AppIconOld) and the default icon specified in Info.plist (AppIcon.icon), but it does not work with another icon (AppIconRed.icon).
All icon names (AppIconOld, AppIcon, AppIconRed) are included in the “Alternate App Icon Sets” in Build Settings.
Also, I can’t display the .icon file as an image. If I use the old method to load it as a UIImage, the image is retrieved, but its appearance is not accurate.
Topic:
UI Frameworks
SubTopic:
SwiftUI