简体   繁体   English

解雇Android弹出窗口

[英]Dismissing an Android popupwindow

I use a popupwindow in my activity that i would like to dimiss, but i see the following documentation about the dimiss() method for popup windows: 我在我的活动中使用了一个popupwindow,我想要dimiss,但是我看到以下关于弹出窗口的dimiss()方法的文档:

public void dismiss () Since: API Level 1 public void dismiss()自:API级别1

Dispose of the popup window. 处理弹出窗口。 This method can be invoked only after showAsDropDown(android.view.View) has been executed. 只有在执行showAsDropDown(android.view.View)之后才能调用此方法。 Failing that, calling this method will have no effect. 如果做不到这一点,调用此方法将无效。 See Also 也可以看看

* showAsDropDown(android.view.View)

If I don't want to show the popup with showAsDropDown how else can u remove it from the main view? 如果我不想用showAsDropDown显示弹出窗口,你怎么能从主视图中删除它?

只要PopupWindow显示在屏幕上,dismiss()就会起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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