Two methods and examples of popwindow pop-up menu in Android

Two methods and examples of popwindow pop-up menu in Android

1. Popwindow is a way of dialog box!

This article explains a way to use the dialog box in Android, which is called popwindow.

2. Popwindow features

There are two dialog boxes for Android: popupwindow and alertdialog. They differ in:

The location of alertdialog is fixed, while the location of popupwindow can be arbitrary.

Alertdialog is non blocking and popupwindow is blocking.

The position of popupwindow can be divided into offset and no offset according to whether there is an offset or not; According to different references, it can be divided into relative to a control (anchor anchor) and relative to the parent control.

Example code:

Activity of method 1

Activity of method 2

Thank you for reading, hope to help you, thank you for your support to this site!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>