Android Flip Bildansicht Vertikal

Ich versuche zu spiegeln und ImageView vertikal, aber es will einfach nicht funktionieren.

Java:

public static void flipImageVertically(final Bitmap bmp, final ImageView imageView) {
    final Matrix matrix = new Matrix();

    matrix.preScale(1.0f, -1.0f);

    imageView.setImageBitmap(Bitmap.createBitmap(bmp, 0, 0, bmp.getWidth(), bmp.getHeight(), matrix, true));
}

XML:

<LinearLayout                
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:layout_weight="1">

    <ImageView
        android:id="@+id/imageView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@color/red" />

</LinearLayout>

Den ImageView ist nicht umlegen auf alle.

Jemand wissen, warum?

InformationsquelleAutor Subby | 2015-03-15

Schreibe einen Kommentar