0
A
回答
0
两个top
和bottom
位置如果你已经有了两个top
和bottom
,那么它只是一个条件:
if ((top1 <= top2 && bottom1 >= top2) || (top2 <= top1 && bottom2 >= top1)) { // intersect/overlap/touch }
-2
我建议你给他们分配一些尺寸(宽度,高度和边框)。您也可以使用UI调试器(通过使用F12键)来查看实际位置。