1

I have a compose view inside a complex XML layout.

<NestedScrollView>
   <ConstraintLayout>
      <LinearLayout>
         <ConstraintLayout>
            **<ComposeView/>**
         </ConstraintLayout>                
      </LinearLayout>      
   </ConstraintLayout>
</NestedScrollView>

Inside compose view, I have a Row inside which I have a TextField.

So, I used bringIntoViewRequester() so that keyboard will not overlap with TextField when we click on TextField.

Row(modifier = Modifier.bringIntoViewRequester(bringIntoViewRequester)){
TextField(modifier = Modifier.onFocusEvent{
      if(it.isFocused){
         coroutineScope.launch{
            bringIntoViewRequester.bringIntoView()
}}})
SaveButton()
}

While I am typing, the text view is not overlapping with the keyboard, but when I click on ENTER KEY the layout is again coming down and so, text view is getting overlapped with keyboard and when I gain start typing, the layout and text field are going up. I have android:windowSoftInputMode:"adjustPan" in manifest file.

Please see the screenshots for your reference.

LayoutImage

LayoutWhileTyping

TextFieldOverlappingWithKeyboardAfterPressingEnterKey

TypingAfterPressingEnterKeyLayoutImage

0 Answers0