문제

I'm trying to show in Android a PopupWindow at the click location. I read that Android does not support getting the click coordinates for some reason.

I want to do something like the little popup that appears on the contacts on Android 2.1+ when you select a person's icon and a window appears at the row location showing different options to contact that person. Also in the twitter application they do something similar.

I guess it is acting more like a Context Menu, but what I read is that Context Menus cannot be customized. How are this popup windows at location done?

Thanks.

도움이 되었습니까?

해결책

There is an easier option for the case of PopupWindow:

The method showAsDropDown(View, int offsetx, int offsety) of the PopupWindow will anchor the window to the given view by the specific offset.

다른 팁

I should have searched more in stackoverflow... There is a sample in this question: How to make Twitter app style Quick Actions on Android

And also here is a guide: http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top