从评级栏中删除手势

发布于 2024-09-14 02:28:03 字数 207 浏览 1 评论 0原文

我有一个带有多个评级栏的活动,以便我的用户可以对许多不同的事物进行评级。我的问题是,这使得我的用户很难上下滚动屏幕。

如果您尝试在屏幕上垂直滑动手指,并且您触摸的第一个点位于评级栏上方,则评级栏会尝试捕获手势本身,而不是在您的手指移开时将其传递(使用评级栏,您可以滑动水平移动评级上下)。

我什至尝试过关闭焦点,但这并不能解决我的问题。

有什么想法吗?

I have an Activity with several RatingBars on it so my users can rate many different things. My problem is that this makes it difficult for my users to scroll up and down the screen.

If you attempt to slide your finger vertically on the screen and the first spot you touch is over a RatingBar, the RatingBar tries to capture the gesture itself instead of passing it along once your finger moves off of it (with a RatingBar, you can swipe horizontally to move the rating up and down).

I've even tried turning focus off, but this doesn't solve my problem.

Any ideas?

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

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

发布评论

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

评论(1

高速公鹿 2024-09-21 02:28:03

您可以将评级栏设置为 isIndicator(true)

ratingBar.isIndicator(true);

我想您需要在应用程序中的某个时刻使用这些评级栏,您可以设置编辑文本或其他任何内容以将评级栏再次设置为正常,以便您可以评级。评级完成后,使用 OnRatingBarChangeListener 将评级栏设置回指示器,

迟到总比不做好!

You can set the rating bar to isIndicator(true)

ratingBar.isIndicator(true);

I guess you would need to use those rating bars at some point in the application, you can set your edittexts or whatever to set the rating bars to normal again so you can rate. Once the rating is done, with a OnRatingBarChangeListener set the rating bars back to indicators

Better late than never!

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