安卓:PopupWindow.showAtLocation() [英] Android:PopupWindow.showAtLocation()

查看:236
本文介绍了安卓:PopupWindow.showAtLocation()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我该参数的详细解释,中的函数 PopupWindow.showAtLocation(查看** **父母,INT W,INT H); 在此先感谢!

Can anyone tell me the detail explanation of the param "parent" in the function PopupWindow.showAtLocation(View **parent**,int w,int h); Thanks in advance!

推荐答案

Android的窗口管理器可以确保在弹出窗口中显示,显示了它的活动上面。为了使窗口管理器要做到这一点,它需要知道有关活动的窗口。由于视图是在一个窗口,它知道该活动是在什么窗口,如果它知道的活动窗口内的视图。

The Android window manager makes sure that the popup window is shown above the activity that showed it. In order for the window manager to do this, it needs to know the window of the activity in question. Since a View is inside a window, it knows what window the activity is in if it knows of a View inside the activity window.

随着的参数,你说我想要的弹出式窗口中的窗口视图的的是,在上述的活动。

With the parent parameter, you say "I want the popup window above the activity in the window that the View parent is in".

这篇关于安卓:PopupWindow.showAtLocation()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆