简体   繁体   中英

Edittext selection menu and soft keyboard

In my activity, I have a multiline EditText that takes a big space on the screen. When I click on it, I enter the edit mode and the soft keyboard shows up. So far so good

Now I want to select the text. So I long press on it, and the selection handles appear. The problem is that when I select multiple lines, the whole layout of the activity will be pushed up to be able to see the selection above the keyboard. But it also pushes up the selection menu that allows to interact with the selection (like Copy, Search, etc.), so the selection is useless!

So best solution would be to make sure the menu stays visible, alternative solution would be to hide the keyboard when selection happens so that nothing is being pushed up.!

As you can see on the screenshot , the menu is almost gone because the selection is right on top of the keyboard, but without the keyboard it should appear just fine

尝试为清单中的活动添加以下内容:

android:windowSoftInputMode="adjustPan"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM