Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VisionOS - How to remove button background?

Tags:

visionos

I'm trying to create a circular button in VisionOS, there is always a background oval that doesn't appear in the iOS version. I'm using SwiftUI and Xcode 15.2:

Button(action: {}) {
      Image(systemName: "arrow.up.circle.fill").resizable().frame(width: 50.0, height: 50.0)                                
}.background(Color.clear)

Changing the background has no effect, what I want is just the circle, but the button keeps adding an oval background that I don't want. How can I get rid of that background? Example of the undesired button is below:

enter image description here

PS: there seems to be the same problem with Navigation Links, the undesired background seems to be set there too. Any guidance would be greatly appreciated.

like image 262
J. Edgell Avatar asked Oct 27 '25 14:10

J. Edgell


1 Answers

Solved by adding .buttonStyle(.plain) to the button.

like image 174
J. Edgell Avatar answered Oct 29 '25 14:10

J. Edgell