我在FrameLayoutview pagerbackround view上有两个孩子
我将背景视图添加为第二个子视图,因此它应该位于视图分页器的顶部。

问题是,尽管页面顶部有另一个视图,我仍然可以滚动视图页面。

结构是:

<FrameLayout>

   <DrawerLayout>contains view pager and content</DrawerLayout>
   <LinearLayout></LinearLayout> -> this is where I add my view as a black background

</FrameLayout>


如何禁用framelayout的第一个孩子的输入和侦听器,或者有更简单的方法吗?

尝试设置elevationbringViewToFront(),但是这些都不起作用。

谢谢

最佳答案

您可以在focusframelayout上禁用enable focus on child views。看看这是否对您有帮助。

framelayout.setFocusable(false);
framelayout.setFocusableInTouchMode(false);


focusabletruedrawerlayout设置为linearlayout。希望这可以帮助。

08-18 09:11
查看更多