UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Day 31 - WordScramble (visual bug)

Forums > Swift

Hi,

i've been tinkering with the project 5 and implementing some ui elements and encountered this weird bug. When the TextField is tapped, the keyboard pops up (which is fine) but there is a visible black line between my NavigatioN and the VStack containing the button. Here is my code and also a GIF of the issue : RPReplay_Final1677854242.gif

  VStack {
            NavigationView {
                List {
                    Section {
                        TextField("Enter your word", text: $newWord)
                            .autocapitalization(.none)
                            .autocorrectionDisabled()
                    }
                    Section {
                        ForEach(usedWords, id: \.self) { word in
                            HStack {
                                Image(systemName: "\(word.count).circle")
                                Text(word)
                            }
                        }
                    }
                }

                .scrollContentBackground(.hidden)
                .background(retroYellow)

                .navigationTitle(rootWord)
                .onSubmit(addNewWord)
                .onAppear(perform: startGame)
                .alert(errorTitle, isPresented: $showingError) {
                    Button("OK", role: .cancel) { }
                } message: {
                    Text(errorMessage)
                }

            }
            VStack {
                    Button {
                        startGame()
                    } label: {
                        Image("restart")
                            .resizable()
                            .clipped()
                            .background(retroYellow)
                            .frame(width: 100, height: 100)
                            .background(retroYellow)

                    }
            }
            Spacer()
            Spacer()

        }.background(retroYellow)

    }

2      

BUILD THE ULTIMATE PORTFOLIO APP Most Swift tutorials help you solve one specific problem, but in my Ultimate Portfolio App series I show you how to get all the best practices into a single app: architecture, testing, performance, accessibility, localization, project organization, and so much more, all while building a SwiftUI app that works on iOS, macOS and watchOS.

Get it on Hacking with Swift+

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.