Android - Rotating an ImageView with finger moves other views around

后端 未结 3 1461
时光取名叫无心
时光取名叫无心 2021-02-03 12:15

I\'ve been learning Android for about two weeks now (expert in as2/3).

I have created a simple LinearLayout1, which contains anImageView`, containing a png

相关标签:
3条回答
  • 2021-02-03 12:17

    Actually thats because you try to rotate a view in a linear layout. And this will cause its dedicated space to expand or shrink.

    Idea 1: try using a frame layout have and your view rotate inside there Idea 2: try a custom view subclass and draw your turntable in the onDraw. In the internet look for a compass drawing example for start.

    0 讨论(0)
  • 2021-02-03 12:19

    Simple and clear, just draw a circle canvas and add your image to the canvas.The canvas image will not have corners. Also, use FrameLayout to lay one image on top of the other, this will solve your problem

    0 讨论(0)
  • 2021-02-03 12:35

    Fix your imageview by

    imageview.setScaleType(ScaleType.CENTER);

    0 讨论(0)
提交回复
热议问题