Android setX() and setY() behaving weird

后端 未结 6 1330
情歌与酒
情歌与酒 2021-01-17 23:10

I am trying to dynamically create and then move an image in an Android activity. However, the setX() and setY() methods seem to not work correctly. It correctly sets the pos

6条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-17 23:26

    Pretty late to answer, but if someone else is facing the same problem. This fixed it for me it was the paddings in the layout file:

    android:paddingBottom="16dp"
    android:paddingLeft="16dp"
    android:paddingRight="16dp"
    android:paddingTop="16dp"
    

提交回复
热议问题