RotateAnimation Drehpunkt ändern

  • Antworten:2
  • Bentwortet
Yannick M
  • Forum-Beiträge: 46

06.02.2013, 16:31:51 via Website

Mein Bild dreht sich um die Ecke oben links. Wie ändere ich das? Sodass das Bild sich zum Beispiel um den eigenen Mittelpunkt dreht.
Vielen Dank.

1int jetzt=0;
2int drehung=10;
3
4@Override
5 public void onClick(View v) {
6
7 switch(v.getId()) {
8
9 case R.id.buttonlinks:
10 rotate = new RotateAnimation(jetzt, jetzt+drehung);
11 rotate.setDuration(200);
12 delphin.startAnimation(rotate);
13 jetzt = jetzt+drehung;
14
15 break;
16
17 //........
18 }
19
20
21
22
23 }

Antworten
Yannick M
  • Forum-Beiträge: 46

05.03.2013, 20:11:13 via Website

Problem gelöst! so:
1rotate = new RotateAnimation(jetzt, jetzt-drehung, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);

Antworten