69 questions
0
votes
0
answers
41
views
SwiftUI Button in List works only with press+slide rather than tap
When checking a checkbox Button in List:
Click/tap events don't trigger the expected response
The associated action button only activates with a press+slide
What could be causing this interaction ...
1
vote
0
answers
89
views
No tap animation when pressing a Button inside a ScrollView with SwiftUI
I am writing an application and have a structure similar to the following:
ScrollView {
VStack {
Button(action: {
print("hello")
}) {
Text("...
1
vote
1
answer
85
views
Connecting a button to .searchable modifier
I have an app with SampleData of country names displayed in a list with the searchable modifier. I also have button on the bottom right of the screen. This is all within the NavigationStack:
...
0
votes
1
answer
182
views
Reduce text and background opacity when Button is disabled
I am learning SwiftUI and currently building a custom button. What I am trying to achieve is, when the button is disabled its opacity should be 0.5 but not the title. The title opacity should be 0.9 ...
-1
votes
1
answer
51
views
Button appears to have an inner and outer area with different actions, how can I make sure only one action is used for both tappable areas
Snapshot of Code and Preview in Xcode
Attached is an image with the button and code for reference. Here's also the code in case you'd like to test this out yourself:
struct ContentView: View {
var ...
0
votes
2
answers
329
views
Text disappears in dark mode when tinting borderedprominent button
The button text does not change colors properly when switching between light and dark mode. In light mode it shows up as a black button with white text. in dark mode it just shows a white button with ...
0
votes
2
answers
142
views
Rounded button background box color
I'd like to make the. box surrounding my rounded button match the background but it's darkened. I would also like to eliminate the dark circle below the button, which looks like it must be generated ...
0
votes
1
answer
37
views
Why is "toggle()" function not producing the same result as explicitly writing out a toggle?
The following block works:
Main File
import SwiftUI
struct Home: View {
@State private var ToDoItems: [ToDoItem] = [ToDoItem(title: "Task", description: "Need to do", urgent: ...
2
votes
1
answer
100
views
Can’t make a button tappable parallel to navigationTitle
The button is not tappable as I move it to the extended line of the title. If I move it to somewhere else, it works but I want to place it on the line of Title.
But whenever I do it, it does not ...
1
vote
0
answers
86
views
SwiftUI Button ListRowBackgroundColor doesn't Change
I'm attempting to recreate a button that simulates the behavior of a NavigationLink inside a List in SwiftUI. However, when tapping the button wrapped inside the List, the listRowBackground color ...
0
votes
2
answers
143
views
How do I make my text navigate me to a subpage?
I have the text "Groups" and I want to use NavigationLink to connect it to my GroupsPage subpage and take the user there when they click the Groups text.
Edit: This is how it looks with the ...
1
vote
1
answer
170
views
How can i get animation when click a button that in List?
My code is like this:
List {
Button(action: {}, label: {
Text("Button")
})
Button(action: {}, label: {
Text("...
1
vote
1
answer
699
views
SwiftUI: Long Press fills button to show progress?
I pieced together this code for a watch app and it kind of works but it's not perfect. (1) The fill does not match exactly, it starts outside the bounds of the buttons view but I can't figure out how ...
0
votes
0
answers
39
views
screen not navigating to other screen based on conditions, on button click
I want to navigate to ChatScreen() based on conditions, when click on right group, print statement is showing "group found" but its not navigating:
List(viewModel.danceGroups) { group in
...
0
votes
2
answers
107
views
Using sheet for presenting different views on 2 buttons actions are presenting view incorrect view
enum ActiveSheet: Identifiable {
case first, second
var id: Int {
return hashValue
}
}
struct ContentView: View {
@State var activeSheet: ActiveSheet?
var body: some ...