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!