Navigation bar pushed upwards when keyboard shows up SwiftUI

687 views Asked by At

I am having trouble why my navigation bar pushed upward when keyboard shows up (refer to the first image). Unlike to the second image (iMessage screenshot), the navigation bar doesn't pushed upwards when keyboard.

enter image description here

enter image description here

Here is my code

import SwiftUI

struct ConversationView: View {
    @State var message : String = ""
    var body: some View {
        VStack {
            Spacer()
            Divider()
            TextField("Write a message here .....",text: $message)
                .padding(.all,10)
                .overlay(
                    RoundedRectangle(cornerRadius: 13)
                        .stroke(Constants.black_100, lineWidth: 1)
                )
        }
        .padding(.all,5)
    }
}
0

There are 0 answers