BLACK FRIDAY SALE: Save 50% on all my Swift books and bundles! >>

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)

    }

   

Save 50% in my Black Friday sale.

SAVE 50% To celebrate Black Friday, all our books and bundles are half price, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.

Save 50% on all our books and bundles!

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

Reply to this topic…

You need to create an account or log in to reply.

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.