Android PopUp ListView

青春壹個敷衍的年華 提交于 2019-12-02 02:12:47

问题


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. Please give some suggestion, its urgent. Thanks in advance.


回答1:


You mean a quick action menu ? Like this ?

If so, check this : http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/




回答2:


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




回答3:


Design a listview inside it RelativeLayout view in that same layout and make it as invisible. once you click a button at the header you can make it visible. which shows the listview.




回答4:


You can create a new Activity for popup and add android:theme="@android:style/Theme.Translucent.NoTitleBar" to Activity node in Manifest file.



来源:https://stackoverflow.com/questions/7981773/android-popup-listview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!