Anchor SuggestionPopup to TextView

巧了我就是萌 提交于 2019-12-12 12:20:12

问题


I have a problem with a custom PopupWindow associated with a TextView with the method setSuggestionPopup.

When I click in the TextView and my layout scrolls up so that the TextView is not covered by the virtual keyboard my custom popup doesn't scroll and it covers the TextView.

Is there a way to anchor it to the TextView so that they are both scrolled as if they were a single object?

I associate the PopupWindow to TextView like that:

popupBinding = PasswordPopupBinding.inflate(LayoutInflater.from(getContext()));
View suggestionView = popupBinding.getRoot();
PopupWindow suggestionPopup = new PopupWindow();
suggestionPopup.setContentView(suggestionView);
binding.passwordTextView.setSuggestionPopup(suggestionPopup);

来源:https://stackoverflow.com/questions/50743867/anchor-suggestionpopup-to-textview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!