I\'m trying to use ListPopupWindow to show a list of strings via an ArrayAdapter
(eventually this will be a more complex custom adapter). Code is below. As shown in
My approach to this.
Create a View
in your layout which functions as an anchor, with your dedicated width and position (Height 1 dp, width as you wish) (may be dynamic i.e. with ConstraintLayouts). Make it invisible (android:visibility=View.INIVISIBLE
).
Reference to this view in your viewAnchor
, (i.e with bindings):
listPopupWindow.anchorView = binding.myAnchor