Floating view on Android screen

前端 未结 3 923
没有蜡笔的小新
没有蜡笔的小新 2020-12-24 08:59

I was trying to make a floating view which user can drag around on the screen.

The idea is to launch a service and then inflate a view on the screen.

But t

3条回答
  •  粉色の甜心
    2020-12-24 09:25

    By default, View will take up the entire available space when laid out with WRAP_CONTENT. You need to either explicitly specify the view size in your WindowManager.LayoutParams, override View.onMeasure, or (ideally) extend ImageView rather than View.

提交回复
热议问题