1. Popupwindow Display and position setting
Window.showatlocation(Parent, Gravity. Right|Gravity.BOTTOM,Ten,Ten);The first parameter specifies a Popupwindowanchor (Anchor) view, which is the view on which to attach.
The second parameter specifies that the starting point is the lower-right corner of the parent, and the third parameter is set to the origin in the lower-right corner of parent, and 10 pixels to the left and the upper.//Popupwindow is displayed as a drop-down window for anchor. Which is shown in the lower left corner of the anchor
Window.Showasdropdown(Anchor);
The //xoff,yoff is offset based on the lower left corner of the anchor.
Window.Showasdropdown(Anchor, Xoff, Yoff);
Supplement
anchor.getlocationonscreen (location);
Rect anchorrect = new rect (location[0], location[1],
Location[0] + anchor.getwidth (),
Location[1] + anchor.getheight ());
A rect is a rectangular area with four coordinates that are lower left and bottom right, respectively.
Popupwindow with Notes