Android 应用程序中的滑块

发布于 2025-01-02 01:01:24 字数 364 浏览 0 评论 0原文

我正在开发一个项目,该项目需要仅在半透明屏幕向上滑动后才按下按钮。这样可以访问主按钮(按图中的“按我”)。我希望顶部屏幕是半透明的,以便用户可以看到其后面的按钮,但我也希望顶部屏幕上有按钮(绿色按钮 1、2 和 3)。有这方面好的教程吗?我看过了,但没有发现太多相关的东西。如果您有任何建议,请告诉我。我还想知道这有多困难,因为我是 Java/Android 新手。下面的插图可以让您更好地了解我想要的内容:

在此处输入图像描述

这与 iPhone 的工作方式类似有一个屏幕可以从顶部拉下来,但是这个总是向下的并且可以向上移动。如果您有任何建议,请告诉我。

谢谢!

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:

enter image description here

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

So要识趣 2025-01-09 01:01:24

我已经根据我的要求尝试了这个演示,它对我帮助很大: Android-Slider 演示

I have tried this demo for my requirement and it helped me a lot: Android-Slider Demo.

森林迷了鹿 2025-01-09 01:01:24

我已经创造了像你正在尝试做的事情。抱歉,我无法发布代码,因为它是我工作的公司的一部分。然而,这就是我所做的。

我将 SlidingDrawer.java 源代码复制到我的项目中,并确保它首先按预期工作。然后我开始将其修改为从顶部而不是底部滑动。我花了一点时间,但这是非常值得的学习经历。

祝你好运!

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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文