Slider in Android App

狂风中的少年 提交于 2019-12-12 07:38:16

问题


I'm working on a project that requires a button to only be pressed once a translucent screen has been slid up. This allows for access to the main button (Press Me, in the picture). I would like for the top screen to be translucent so a user can see the button behind it, but I would also like to have buttons (green buttons 1, 2, and 3) on the top screen. Are there any good tutorials on this? I have looked, but haven't found much that relates a whole lot. If you have any sugguestions please let me know. I'd also like to know how difficult this is since I'm new to Java/Android. Here's the illustration to give you a better idea of what I want:

This would work similar to how the iPhone has the screen that can be pulled down from the top, but this one is always down and can be moved upward. Let me know if you have any suggestions.

Thanks!


回答1:


I have try this demo for My requirement and it helps me a lot: Android-Slider Demo

Just Try it for your purpose and it will surly help you.

Enjoy. :)




回答2:


I have created something like you are trying to do. Sorry I can't post the code since it's part of the company I work for. However here is what I did.

I copied the SlidingDrawer.java source to my project and made sure it was first working as expected. I than started modifying it to slide from the top and not the bottom. Took me a little time but it was well worth the learning experience.

Good luck!



来源:https://stackoverflow.com/questions/9088826/slider-in-android-app

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