Android 弹出列表视图
我想在我的 Android 应用程序中实现一个功能,例如当用户单击标题中的按钮时,会弹出一个小列表视图,在屏幕一角有 5 个值。请大家给点建议,很紧急。提前致谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您是指快速操作菜单吗?像这样 ?
如果是这样,请检查以下内容:
http://www.londatiga.net/it /如何在android中创建quickaction-dialog-
You mean a quick action menu ? Like this ?
If so, check this :
http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/
这在一定程度上取决于您所针对的最低 SDK。如果您能够以 Android 3.0(API 级别 11)的最低目标编写应用程序,那么您至少可以使用两个类来完成创建锚定到另一个视图(在本例中为您的按钮)的简单弹出窗口:
否则,您需要对 PopupWindow,这是许多早期 QuickAction 实现所基于的类。
华泰
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):
Otherwise, you will need to do a little customization of PopupWindow, which is the class that many early QuickAction implementations are based on.
HTH
在同一布局中设计一个列表视图,并使其不可见。一旦您单击标题上的按钮,您就可以使其可见。显示列表视图。
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.
您可以为弹出窗口创建一个新的 Activity,并将
android:theme="@android:style/Theme.Translucent.NoTitleBar"
添加到 Manifest 文件中的 Activity 节点。You can create a new Activity for popup and add
android:theme="@android:style/Theme.Translucent.NoTitleBar"
to Activity node in Manifest file.