如何在按钮上创建选项卡和设置页面?
这有点难以解释,所以我将尝试举一个简单的例子来说明我想要实现的内容。
答:当在市场应用程序中按下菜单按钮时,按钮上会出现某种选项卡,我该如何实现?
B.现在按设置(在按市场应用程序中的菜单按钮后), 有没有办法创建这种布局,或者我必须从头开始(如果没有“简单”的方法来做到这一点,我真的很感激代码示例)。
This is a bit difficult to explain, so I'll try to give a simple example to what I'd want to implement.
A. When the menu button is pressed in the Market app there are some kind of tabs on the buttom, how can I implement this ?
B.now press the settings (after you press the menu button in the Market app),
Is there a way to create this kind of a layout or I have to start from scratch (I would really appreciate code example for this if there is no 'easy' way to do this).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你这里指的不是布局。这是在 Android 应用程序中创建菜单的标准方法。
查看 Android 开发人员指南中的以下主题:http://developer。 android.com/guide/topics/ui/menus.html
关于你的第二个问题:对于设置/首选项,你可以使用 PreferenceScreen/PreferenceActivity。这在这里显示得很好:http://www.javacodegeeks。 com/2011/01/android-quick-preferences-tutorial.html
What you are referring to here is not a layout. This is the standard way of creating menues in Android applications.
Have a look at the following topic in the Android developer guide: http://developer.android.com/guide/topics/ui/menus.html
And regarding your second question: for settings/preferences, you can use a PreferenceScreen/PreferenceActivity. This is shown pretty well here: http://www.javacodegeeks.com/2011/01/android-quick-preferences-tutorial.html
如果您所说的选项卡是指单击菜单后弹出的按钮,那么您将创建自己的选项菜单。
http://developer.android.com/guide/topics/ui/menus.html
编辑:对于 B,请查看 PreferenceScreen/PreferenceActivity,如本文答案中所述。为了方便起见,仅在此处更新链接。
http://developer.android.com/reference/android/preference/PreferenceScreen.html
http://developer.android.com/reference/android/preference/PreferenceActivity.html
If, by tabs you mean the buttons that pop up after clicking menu, you will have create your own options menu.
http://developer.android.com/guide/topics/ui/menus.html
EDIT: For B, check out the PreferenceScreen/PreferenceActivity, as mention in an answer to this post. Just updating here with link for convinience.
http://developer.android.com/reference/android/preference/PreferenceScreen.html
http://developer.android.com/reference/android/preference/PreferenceActivity.html