128 questions
0
votes
2
answers
112
views
How to Eliminate Form Padding in NavigationStack
I have a form being loaded inside a navigation stack and I'm showing an image and title in the first form section with the code below:
Form {
Section {
VStack {
Image("...
0
votes
0
answers
69
views
Form Items inside scrollview randomly stops being clickable
I need view like this in order to have fixed size form with scrollable capability.
I have disclosure groups, buttons and textfields inside form.
struct ContentView: View {
var body: some View {
...
0
votes
1
answer
51
views
List, form updating and cursor issue
I`ve adapt official Apple tutorial app for my needs.
There is a ContentListView that displays a list of recipes on one side and a form to edit the selected recipe on the other. The form includes a ...
3
votes
1
answer
68
views
Give Form Section a Background Color/Gradient
This is my code:
Form {
Section {} // regular section no background
Section { // <--- want this section to have a background color
Text("Hello")
}
.background(Gradient(...
3
votes
2
answers
4k
views
No tap animation when clicking a Button inside a Form in SwiftUI
I am using a Form in SwiftUI based on a tutorial from YouTube, and I have placed some components inside it. However, when I tap the button, it doesn't show the tap animation (For example, when I tap a ...
4
votes
1
answer
1k
views
How to change the background color of a form?
I'm not able to change the background color of a Form in SwiftUI for iOS < 16. It always takes default form backgroundcolor depending on which color scheme is selected in the iPhone settings. All ...
1
vote
1
answer
147
views
SwiftUI How to change Background Color of NavigationView with Form?
Is there possibility to change background color of this view?
Note: I dont want to change form sections color, i want to change background color of view.
`.background(Color.red) does not effect.
init()...
0
votes
1
answer
445
views
How do you remove the margin from the top of the screen to a form?
I have this space between the top of the screen and my text input box. How can I reduce this space? I don't want to bring the input box up too far as it will be obstructed by the notch. However, I ...
0
votes
1
answer
169
views
SwiftUI Form space between two buttons
I have a form with 2 buttons. Now I would like to have a little space between these two buttons. Exactly like in this example:
Does anyone know how to implement this?
I appreciate any help!
-2
votes
2
answers
589
views
How do I create a certain number of TextFields based on User Input?
I want to create a certain amount of TextFields on a view based on the number the user inputs. For Example, if the user inputs 5 I would like to display 5 TextFields on the view. I was thinking about ...
1
vote
0
answers
1k
views
SwiftUI IOS: Editable list in a form?
I would like to make my list in a form editable and sortable with the editMode. I've already tried using .environment(.editMode, .constant(.active)) on the list or on the ForEach loop, but ...
0
votes
1
answer
588
views
How to conditionally render a SwiftUI Form with animation using the selection from a Segmented Picker?
I'm trying to conditionally render two Forms based on the selection from a segmented picker. It all works fine when there's no animations, but the moment I add them in, the first Form seems to break.
...
0
votes
1
answer
322
views
Animations cause From view to break in SwiftUI
I have been trying to animate the transition between 2 views that contain Form views in SwiftUI. However the layout breaks only when the animation applies.
This is a fully reproducible example. (Only ...
0
votes
1
answer
368
views
Prefill textfields in SwiftUI is broken in iOS 15
In iOS 14 I've following code which prefills all textfields from the coredata model
struct EditSimpleSearchView: View {
@Environment(\.managedObjectContext)
private var viewContext
@...
1
vote
2
answers
1k
views
Apply modifier to VStack inner views
I want to create a ViewModifier, which when applied to a VStack it makes its style look like a List inside a Form, as presented in the image below. I have multiple custom scenarios where Lists don't ...
0
votes
1
answer
1k
views
SwiftUI - Move text to Header when scrolling up
I want when I scroll up the Text ("Hello") will stay fixed, and the text "Welcome " will move up to be on the same line as Text("Hello").
Hope you can give me some ...
1
vote
1
answer
710
views
Random white line showing up between views when using Form
I've been messing with this for quite some time now and cannot for the life of me figure out where this little white line is coming from. I tried setting .padding(0) and using a .frame() but nothing ...
1
vote
1
answer
660
views
NavigationView issue with "Form" Picker inside NavigationLink child
I have a trouble trying to put my Picker inside NavigationLink child struct.
MyProblem
As you see after some transition (Main Page -> Testing Page -> Picker) and choosing any pickers desire ...
6
votes
0
answers
548
views
SwiftUI toolbar covered by keyboard accessory view
Hi there I have a tricky problem to solve with SwiftUI in Xcode 12.4 (iOS 14): given I have a Form with numerous sections and TextEditors, this form having a .toolbar modifier (bottom bar) with some ...
2
votes
1
answer
3k
views
Swiftui view not updating list after data append to array
I have three files: AddAssignment, ViewAssignment and Task.
A button is clicked on AddAssignment.swift which successfully appends form data to an array inside of Task.swift.
However, in a file ...
1
vote
1
answer
355
views
File importer/ File Mover methods are not getting invoked when using Form swift UI
even though the binding properties in fileMover are set to true. file mover is not getting executed. Below is the sample code i have used. Any leads will be helpful.
Thanks in advance.
var body: ...
1
vote
2
answers
1k
views
Swift @Published causing didSet recursion
What is wrong with the following test code ? When I enter a character into the field, the didSet goes into a recursive loop. If the inout + & are removed, the code functions as expected with ...
3
votes
2
answers
1k
views
SwiftUI Binding to a list element only updates values input in the right order
I have an edit view that is presented by a NavigationLink. It takes a recipe, which is held in a manager that has an array of them.
App Code (copy pasta should run):
import SwiftUI
@main
struct ...
2
votes
3
answers
797
views
AutoComplete search in swiftui not working
I have a TextField as search box.I want to make it autosearch i.e whenever i will enter a letter in the TextField, i should get the result without press a enter.Here is my code:
TextField("Search&...
1
vote
0
answers
477
views
SwiftUI - Material Components , TextFields
I want to use mdc components in my SwiftUI app.
I created a class with protocol UIViewRepresentable, but I would like to modify the height to some constant or maybe remove inner padding.
func ...