简体   繁体   English

如何创建Android Google Plus App等按钮

[英]How to create buttons like Android Google Plus App

I am new to Android development, and I am wondering if there are any samples available to create a panel similar to the photo/checkin/mood/write panel at the bottom of the google+ app on android. 我是Android开发的新手,我想知道是否有任何样本可用于创建类似于Android上google + app底部的photo / checkin / mood / write面板的面板。

1) Are they 4 buttons? 1)它们是4个按钮吗? How do I style the buttons to look like that? 如何设置按钮的样式?

2) I want to auto hide the panel on scroll down, but show on scroll up. 2)我想在向下滚动时自动隐藏面板,但在向上滚动时显示。

Appreciate if anyone could guide me in the right direction. 感谢是否有人可以指导我正确的方向。

Cheers 干杯

Android Google Plus应用

To show\\hide panel - use animation . 要显示\\隐藏面板 - 使用动画

This panel can be linearLayout with 4 buttons. 此面板可以是4个按钮的linearLayout。

Do detect what've been scrolled look at: Synchronise ScrollView scroll positions - android 检测已滚动的内容: 同步ScrollView滚动位置 - android

您可以使用linearlayout并在其中进行imageview ..滚动时可以显示/隐藏linearlayout ..对于视图,您可以使用linearlayout颜色作为黑色和此imageview图像..

OK, so I implemented exactly what you trying to do only without the buttons. 好的,所以我实现了你想要做的只是没有按钮。

After lot of hours spending googling around I found this one - https://gist.github.com/imminent/4576886 by Dandre' Allison, which is a specific implantation of quick return bar for a list view which is little more trickier from other view components. 经过几个小时的谷歌搜索后,我发现了这个 - 欢迎来自Dandre'Allison的https://gist.github.com/imminent/4576886 ,这是一个快速返回栏的特定植入,用于列表视图,这对其他人来说更加棘手查看组件。 For more implementations of quick return bar and other scrolling tricks you can use Roman Nurik's Scrolling Tricks library here https://plus.google.com/u/0/+RomanNurik/posts/1Sb549FvpJt and here http://www.androidviews.net/2012/11/scrolling-tricks/ . 有关快速返回栏和其他滚动技巧的更多实现,您可以在此处使用Roman Nurik的滚动技巧库https://plus.google.com/u/0/+RomanNurik/posts/1Sb549FvpJt和此处http://www.androidviews。 net / 2012/11 / scrolling-tricks / I just saw that there is another quick return bar for list view implenation by Lars Werkman in https://github.com/LarsWerkman/QuickReturnListView which I never tested. 我刚刚看到Lars Werkman在https://github.com/LarsWerkman/QuickReturnListView中有一个列表视图实现的另一个快速返回栏,我从未测试过。 I used the Dandre' Allison snippet which works great. 我使用了Dandre'Allison片段,效果很好。

Answering your first question. 回答你的第一个问题。

  • all the buttons are either in ImageButton, or in ImageView that make it clickable. 所有按钮都在ImageButton中,或在ImageView中使其可单击。 it's either you can lay it out in LinearLayout or RelativeLayout, well it's depends on how you want to make it. 它可以在LinearLayout或RelativeLayout中进行布局,这取决于你想要如何制作它。

尝试使用拆分操作栏,这基本上可以为您完成任务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM