Android PopUp ListView

后端 未结 4 1812
清酒与你
清酒与你 2021-01-21 07:27

I want to implement in my android application a functionality like when a user clicks a button in header a small list view is popup having 5 values in the corner of the screen.

4条回答
  •  鱼传尺愫
    2021-01-21 07:46

    It depends somewhat on the minimum SDK that you are targeting. If you are able to write your application with a minimum target of Android 3.0 (API Level 11), then there are at least two classes that you can use to accomplish creating a simple popup anchored to another view (in this case, your button):

    • ListPopupWindow
    • PopupMenu

    Otherwise, you will need to do a little customization of PopupWindow, which is the class that many early QuickAction implementations are based on.

    HTH

提交回复
热议问题