片段布局似乎不是交互式/可点击的 [英] Fragment layout seems to not be interactive/clickable
问题描述
这是棘手的或有问题的东西.
So here's the tricky or buggy thing.
我有一个活动来显示地图视图(我根本不认为这很重要,但是该地图视图来自Carto Mobile SDK),并且我有一些动作可以触发在当前活动中显示两个片段布局.
I have an activity that displays a mapview (I don't believe this is important at all, but the mapview is from Carto Mobile SDK), and I have a few actions that trigger two fragments to be displayed over the current activity layout.
第一个显示整个屏幕,并且是完全交互式的.有一个工具栏,一些微调器和一些TextView.
The first one, takes the whole screen and is fully interactive. There is a Toolbar, a few Spinners and some TextViews.
显示的第二个片段占据了屏幕的一部分(几乎是下半部分),并且我包含的元素是交互式的(3个图像按钮).但是,如果我单击位于屏幕下半部分的那部分布局,它的背景为白色,就好像触摸事件是不可见的".
The second fragment that gets displayed, takes a portion of the screen (almost the lower half), and the elements I included are interactive (3 Image Buttons). However, if I click over a part of that layout that's on the lower half of the screen, that has a white background, is like it's 'invisible' to the touch event.
让我改一下.有一个白框,如果我触摸它并执行移动,就好像我在移动地图(它后面的地图视图,可以部分看到)一样,然后我就可以看到地图在移动.即使我看到的是带有3个图像按钮的白色LinearLayout,但是如果我单击没有任何图像按钮的某个地方,就好像LinearLayout不存在并且地图会移动.
Let me rephrase it. There's a white box, that if I touch over it and I perform a movement, like if I was moving the map (the mapview behind it, which I can partially see), I can then see the map moving. Even though I'm seeing the white LinearLayout, with 3 Image Buttons in it, if I click somewhere where there isn't any of the Image Buttons, is like the LinearLayout isn't there and the map moves.
我在最后附上了一个屏幕截图.我所讨论的区域位于图像"按钮的顶部(路由到",路由从"和查看详细信息").
I attached a screenshot at the end. The area that I talk about is just on top of the Image Buttons (Route to, Route from and View details).
我可以阻止这种情况发生吗?这是由于Carto还是Android造成的?
Can I stop that from happening? Is this due to Carto or is an Android thing?
推荐答案
您没有在上面放置任何代码,因此我认为您的根视图没有单击事件,只有3个按钮具有
You don't put any code above so I assume your root view doesn't have click event, only the 3 buttons have.
将clickable="true"
添加到白板的根视图中以捕获所有触摸事件
Add clickable="true"
to your white panel's root view to capture all the touch event
这篇关于片段布局似乎不是交互式/可点击的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!