问题描述
我创建了一个带有标记的地图视图.看看下面这张图:Grandparent
是一个填充视图Parent
是我的 MarkerViewChild
是一个可点击的标记
I have a created a mapview with markers on it.Looking at this picture below:Grandparent
is a filling ViewParent
is my MarkerViewChild
is a marker which is clickable
父级有 clipChildren(false),因此子级是可见的.
Parent has clipChildren(false) and thus the children are visible.
我的问题是孩子是可点击的,除了Child 2
在Parent
之外的部分.Parent
也有适当的 TouchDelegate
(我也为孩子们试过这个).
My problem is that the children are clickable, except for the part where Child 2
is outside the Parent
.Parent
also has the appropriate TouchDelegate
(and I also tried this for the children).
如何使完整的子项可点击?
How can I make the complete child clickable?
推荐答案
如果不更改元素,我无法让它工作.
我最终扩大了父级并使用 setTranslationY 作为标记以将它们保持在这样的位置:
I couldn't make it work without changing the elements.
I ended up enlarging the parent and using setTranslationY for the markers to keep them in place like this:
这篇关于孩子在父视图之外不可点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!