FloatWindow
FloatWindow copied to clipboard
布局的子view设置监听,会导致无法拖拽
比如说:用frameLayout包裹imageView,然后为imageView设置点击事件,将不会走frameLayout的onTouchListener,最终无法拖拽。
FrameLayout frameLayout = new FrameLayout(getApplicationContext());
ImageView imageView = new ImageView(getApplicationContext());
imageView.setImageResource(R.drawable.icon);
frameLayout.addView(imageView);
比如说:用frameLayout包裹imageView,然后为imageView设置点击事件,将不会走frameLayout的onTouchListener,最终无法拖拽。
FrameLayout frameLayout = new FrameLayout(getApplicationContext()); ImageView imageView = new ImageView(getApplicationContext()); imageView.setImageResource(R.drawable.icon); frameLayout.addView(imageView);
解决了吗兄弟
兄弟 写了个新的,完美解决:https://github.com/princekin-f/EasyFloat