自定义按钮Android增加了触摸事件的百分比
我需要在Android中实现此UI。当向右滑动时,它会增加百分比和蓝色视图在两种方面增加,而滑动左右则减少了它,在文本视图中,视图和百分比。我能做到的任何想法吗?谢谢
I need to achieve this UI in Android. When sliding right, it increases the percentage and the blue view increases in both ways, and when sliding left it decreases it, both view and percentage in TextView. Any ideas I can do that? Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使用了 library 它的设计几乎与所需的设计相同。如果不方便,您可以检查实现并创建自己的自定义视图。基本上,您需要在
onTouchListener
中跟踪触摸事件,并用从OnTouch获得的坐标来借鉴画布。I used the library that has almost the same design that you need. If it's not convenient for you can check implementation and create your own custom view. Basically you would need to track touch events in
OnTouchListener
and draw on Canvas with coordinates that you got from OnTouch.