Splash Bild hat oben und unten weißen Rahmen.

  • 1 Antworten
  • Letztes Antwortdatum
T

the_time

Ambitioniertes Mitglied
0
Hallo,
ich versuche eine splash Bild zu meiner App hinzufügen, welches ich mit meinem S4 Samsung Galaxy gemacht habe aber ich kriege zu viel weißen leeren Platz oben und unten. Ohne " android:scaleType="centerCrop"" bildet sich der weiße Rahmen ums Bild also an die Seiten auch. Ich habe mein Bild im drawable-hdpi Verzeichnis. Davor hatte ich es auch in allen drawable verzeichnis aber ich kriegte das raus.

Code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout      
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<FrameLayout
    android:id="@+id/fl_draw"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true">

    <ImageView
        android:id="@+id/imageView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:src="@drawable/splash_background"
        android:rotation="90"
        android:scaleType="centerCrop"
        android:adjustViewBounds="true" />

</FrameLayout>

</RelativeLayout>

Ich habe es davor mit diesem Code versucht aber das Bild wurde waagerecht angezeigt. Ich habe öfter dieses Code benutzt und es hat immer gut geklappt aber die Bilder stammen dann aus dem Internet und nicht mit dem S4.

Code:
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
     android:background= "@drawable/splash_background"
    >
  
</LinearLayout>

Freundliche Grüße,
the_time
 
Ich habe diese Attribute gelöscht und es wird jetzt wie ich will angezeigt.

Code:
   android:rotation="90"
            android:adjustViewBounds="true"
 
Zurück
Oben Unten