<span style="font-size:18px;">/**
* 显示弹窗列表界面
*/
public void show(View view){
//获得点击屏幕的位置坐标
view.getLocationOnScreen(mLocation);
//设置矩形的大小
mRect.set(mLocation[0], mLocation[1], mLocation[0] + view.getWidth(),mLocation[1] + view.getHeight());
//显示弹窗的位置
showAtLocation(view, popupGravity, mScreenWidth - LIST_PADDING - (getWidth()/2), mRect.bottom);
}</span>
Android根据屏幕点击位置显示(此处是PopupWindow)
最新推荐文章于 2021-12-24 13:36:52 发布