awonderer
awonderer

Reputation: 685

Bottom sheet closes when keyboard opens

I added a very basic layout using Bottom sheet behavior. The bottom sheet's layout has a EditText.

When keyboard opens, it closes the bottom sheet layout. What are some ways I can keep the bottom sheet view group there when keyboard is opened?

Upvotes: 2

Views: 2532

Answers (3)

Mor S.
Mor S.

Reputation: 123

For me this works.

<activity   
...        
android:windowSoftInputMode="adjustPan">
</activity>

Upvotes: 3

Gabriel Juan
Gabriel Juan

Reputation: 77

could you post the entire layout?

In my case, my bottom sheet use layout_gravity = "bottom"

After I remove the layout_gravity the bottom sheet is not disappearing anymore.

Upvotes: 4

ozo
ozo

Reputation: 761

I don't know whether it works in BottomSheet, but you may give a try for the following line in your AndroidManifest file.

<activity
...
   android:windowSoftInputMode="adjustResize"> 
</activity>

Upvotes: 0

Related Questions