如何向 Android Activity 添加工具栏?
Android 官方 Twitter 客户端有一个漂亮的工具栏,当您单击消息时可以转发、回复等。我如何重新创建这样的工具栏?
The official Twitter client for Android has a nice toolbar when you click on a message that lets you retweet, reply, etc. How can I re-create a toolbar like that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于 LinearLayout 方法,代码很简单,只需添加一些权重并尝试您想要的内容。这让您对该方法有一个粗略的了解:
结果如下: https://i.sstatic.net/bShgb.png
也可能对 ActionBar 感到满意,只需查看 API 要求:http://developer.android.com/guide/topics/ui/actionbar.html
For the LinearLayout approach, the code is simple, just add some weights and play around with what your looking for. This gives you a rough idea of the approach:
And results in something like this: https://i.sstatic.net/bShgb.png
You may also be happy with ActionBar as well, just watch the API requirements: http://developer.android.com/guide/topics/ui/actionbar.html
我们称之为 QuickAction:
在此处了解有关如何实现的更多信息:http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-安卓/
We call it QuickAction:
Find more about how to implement it here: http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/