When utilizing PhotosPicker on visionOS the content material has a background coloration, how do I take away this? I’ve seen the identical with Stepper.
Instance:
Code:
import SwiftUI
import PhotosUI
struct AddImageView: View {
@State non-public var avatarItem: PhotosPickerItem?
@State non-public var avatarImage: Picture = Picture("ProfileImageEmpty")
@State non-public var ref: Picture = Picture("ProfileImageEmpty")
var physique: some View {
VStack(alignment: .middle, spacing: 8) {
PhotosPicker(choice: $avatarItem, matching: .photos) {
ZStack(alignment: .middle) {
avatarImage
.resizable()
.modifier(CoverImage())
if avatarImage == ref {
HStack(alignment: .middle, spacing: 8) {
Picture(systemName: "digicam")
.font(.system(measurement: 18, weight:.semibold))
Textual content("Add Picture")
.modifier(Subtitle())
}
}
}
}
.background(.clear)
.onChange(of: avatarItem) {
Job {
if let loaded = strive? await avatarItem?.loadTransferable(kind: Picture.self) {
avatarImage = loaded
} else {
print("Failed")
}
}
}
}
.body(maxWidth: .infinity)
}
}