Android阻止scrollview滚动到videoView [英] Android prevent scrollview from scrolling to videoView

查看:130
本文介绍了Android阻止scrollview滚动到videoView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果视频是隐藏的,则滚动视图将按预期方式工作-保持滚动到顶部.但是,如果加载了视频,则滚动视图将跳转到该视频.我尝试禁用VideoView上的所有对焦功能,但是没有运气.在视频"视图上是否有禁用此行为的东西?

If the video is hidden, the scroll view acts as expected - it stays scrolled to the top. However, if the video is loaded, the scroll view jumps to that video. I tried disabling all focusability on the VideoView but no luck. Is there something on Video view that disables this behavior?

推荐答案

刚发布后就想通了...需要设置android:descendantFocusability="blocksDescendants"

Just figured it out right after posting... need to set android:descendantFocusability="blocksDescendants"

就我而言,它必须继续使用LinearLayout,该LinearLayout包含包含VideoView的滚动视图

In my case, it had to go on the LinearLayout that contained the scroll view that contained the VideoView

这篇关于Android阻止scrollview滚动到videoView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆