Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rotate imageview around its center without cutting off its edges

I've customized imageview but its just rotating its bitmap not the whole view. I don't want to use animation because I'm dragging imageview as well so moving animated imageivew results weird, so sticking to onDraw/draw, plus overriding draw is nothing doing special.

        @Override
        protected void onDraw(Canvas canvas) {
        // TODO Auto-generated method stub
        canvas.save();
        canvas.rotate(rotationAngle, rotationW, rotationH);
        super.onDraw(canvas);
        canvas.restore();
        }    

how can I rotate the whole view not only its bitmap??

like image 470
Khawar Avatar asked Sep 14 '12 05:09

Khawar


1 Answers

I did not get the provided answers intend here, but using

android:clipChildren="false"

for the parent ViewGroup and overriding draw instead of onDraw did the job for me

For further information see: Rotating imageview and its background without cropp

like image 181
Murmel Avatar answered Oct 10 '22 09:10

Murmel