I applied the View Modifier on a HStack that includes a TextField and a Button. Although the keyboard adaptivity works fine, the initial height has increased and my content has been centred automatically.
HStack(alignment: .bottom) {
TextField("Write a Comment", text: $newComment)
.padding(.all, 10)
.font(.system(size: 12))
.background(Color.gray.opacity(0.1))
.cornerRadius(10)
Button(action: {
print(self.newComment)
}) {
Image(systemName: "paperplane.fill")
.font(.system(size: 20))
}
.disabled(newComment.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty)
}
.keyboardAdaptive()
.padding(.all, 10)