两个片段之间拖放 [英] Drag and drop between two fragments

查看:107
本文介绍了两个片段之间拖放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作对UI在同一时间看到两个不同的片段之间拖放。

I am working on drag and drop between two different fragments visible at same time on UI.

我想从一个片段拖到视图到另一个片段。我能够片段,但我所面临的不是很好的是,我不能ondrag当听关于第一个片段的视图第二个片段之间拖动。

I want to drag view from one fragment into the other fragment. I am able to drag it between the fragment but what i am facing not good is that i can't listen onDrag on second fragment for the view of first fragment.

在短期上第二个片段的OnDragListener应该监听从第一个片段拖了意见。

In Short the OnDragListener on second fragment should listen for the views dragged from first fragment.

我有很多搜索在谷歌和计算器。没有找到任何答案。

I have searched alot on google and stackoverflow. Didn't find any answer.

拖放两个片段之间的视图

两个片段之间拖放?

我有人知道请共享。

推荐答案

你有没有考虑建立两个片段,该不该拦截触及上方的叠加视图,但只要你开始拖动的观点 - 它的一个副本会在这种叠加产生,并按照拖动?我看不到这个实施任何其他方式,因为两个片段具有独立的视图层级和我能看到的唯一途径是通过活动的视图层次转移视图

Have you considered creating an overlaying View above both Fragments, which should not intercept touches, but as soon as you start dragging the view - a copy of it will be created in this overlay and follow the dragging? I can't see any other way of implementing this, since two Fragments have separate view hierarchies and the only way I can see is transfer the View through Activity's view hierarchy

BTW,有没有办法避免使用两个片段?你有什么样的用例?

BTW is there any way to avoid using of two Fragments? What kind of use case do you have?

这篇关于两个片段之间拖放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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