FloatWindow icon indicating copy to clipboard operation
FloatWindow copied to clipboard

布局的子view设置监听,会导致无法拖拽

Open princekin-f opened this issue 5 years ago • 2 comments

比如说:用frameLayout包裹imageView,然后为imageView设置点击事件,将不会走frameLayout的onTouchListener,最终无法拖拽。

FrameLayout frameLayout = new FrameLayout(getApplicationContext());
ImageView imageView = new ImageView(getApplicationContext());
imageView.setImageResource(R.drawable.icon);
frameLayout.addView(imageView);

princekin-f avatar Jul 10 '19 09:07 princekin-f

比如说:用frameLayout包裹imageView,然后为imageView设置点击事件,将不会走frameLayout的onTouchListener,最终无法拖拽。

FrameLayout frameLayout = new FrameLayout(getApplicationContext());
ImageView imageView = new ImageView(getApplicationContext());
imageView.setImageResource(R.drawable.icon);
frameLayout.addView(imageView);

解决了吗兄弟

jokerrou avatar Aug 14 '19 03:08 jokerrou

兄弟 写了个新的,完美解决:https://github.com/princekin-f/EasyFloat

princekin-f avatar Aug 14 '19 03:08 princekin-f