Ich habe ein ImageView in meinem Android-Projekt. Und ich muss diese Bildansicht in einigen Fällen drehen. Alle Rotationen werden mit Hilfe der Rotationsanimation durchgeführt. Wenn ein ImageView jedoch um 90 oder 270 Grad gedreht wird, wird das darin enthaltene Bitmap oben und unten abgeschnitten. Und ich habe keine Ahnung, warum das passiert. Kann mir jemand einen Rat geben, wie man solches Verhalten vermeidet?Bitmap in ImageView wird nach der Drehung abgeschnitten
final ImageView photoView = (ImageView) main_activity.findViewById(R.id.photo_view);
RotateAnimation mRotateAnim = new RotateAnimation(oldRotation, newRotation, photoView.getPivotX(), photoView.getPivotY());
mRotateAnim.setDuration(500);
mRotateAnim.setFillAfter(true);
photoView.startAnimation(mRotateAnim);
Und das ist meine Image Erklärung innerhalb XML-Datei:
<ImageView
android:id="@+id/photo_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:layout_above="@+id/bottom_container"
android:adjustViewBounds="true"/>
Sie eine Lösung gefunden? – Juvi