Post

Replies

Boosts

Views

Created

visionOS SwiftUI rounded square button
I'm writing a visionOS App using SwiftUI language, in which I wrote a button with the following code: import SwiftUI Button(action: { openWindow(id: landmark.windowTag) }) { VStack { Image(landmark.imageName) .resizable() .aspectRatio(contentMode: .fill) .clipShape(RoundedRectangle(cornerRadius: 10)) .frame(width: 150, height: 150) VStack(alignment: .leading){ Text(landmark.name) .font(.title) .foregroundColor(.white) Text(landmark.describe) .font(.subheadline) .foregroundColor(.gray) } } .frame(width: 200, height: 400) .padding() .clipShape(RoundedRectangle(cornerRadius: 20)) } .padding(20) My idea is that the border of the button is a rounded square (note that I'm not talking about the picture is a rounded square, but the border of the button is a rounded square), but the default button border of visionOS is oval, so I added the following code: .clipShape(RoundedRectangle(cornerRadius: 20)) But there is no change in operation, and the border of the button has not become a rounded square. It is still the default oval of visionOS. How can I modify the code?
1
0
2.4k
Aug ’23
visionOS SwiftUI rounded square button
I'm writing a visionOS App using SwiftUI language, in which I wrote a button with the following code: import SwiftUI Button(action: { openWindow(id: landmark.windowTag) }) { VStack { Image(landmark.imageName) .resizable() .aspectRatio(contentMode: .fill) .clipShape(RoundedRectangle(cornerRadius: 10)) .frame(width: 150, height: 150) VStack(alignment: .leading){ Text(landmark.name) .font(.title) .foregroundColor(.white) Text(landmark.describe) .font(.subheadline) .foregroundColor(.gray) } } .frame(width: 200, height: 400) .padding() .clipShape(RoundedRectangle(cornerRadius: 20)) } .padding(20) My idea is that the border of the button is a rounded square (note that I'm not talking about the picture is a rounded square, but the border of the button is a rounded square), but the default button border of visionOS is oval, so I added the following code: .clipShape(RoundedRectangle(cornerRadius: 20)) But there is no change in operation, and the border of the button has not become a rounded square. It is still the default oval of visionOS. How can I modify the code?
Replies
1
Boosts
0
Views
2.4k
Activity
Aug ’23
MapKit with vision
Does visionOS support mapkit?
Replies
2
Boosts
0
Views
1.8k
Activity
Jun ’23
Create a visionOS project
How to create a visionOS project in Xcode15.0beta
Replies
4
Boosts
0
Views
1.2k
Activity
Jun ’23
Unity games are on the shelves of arcade
Excuse me, games developed with Unity can be put on the arcade?
Replies
0
Boosts
0
Views
993
Activity
May ’23
createML Importing Xcode swiftui app
I used createML to generate a text-categorized mlmodel file. I want to import it into my app and let users use it. How can I pour in and write code? Please note: 1. My app was written with SwiftUI. 2. This createML mlmodel file is used for text classification.
Replies
1
Boosts
0
Views
1k
Activity
Sep ’22
transporter
How to upload apps using transporter?
Replies
1
Boosts
0
Views
711
Activity
Feb ’22
transporter
How to use transporter?
Replies
1
Boosts
0
Views
1.2k
Activity
Feb ’22