ImageViews + unterschiedliche Auflösung

S

SljnX

Neues Mitglied
0
moin moin,

habe mal ein kleines anliegen.
habe eine kleine app geschrieben welche als "startbildschirm" bilder enthält.

mein problem hierbei ist, dass dieser je nach auflösung anders aussieht und die imageviews total verschoben sind.
bei den geräten mit denen ich es getestet habe (Galaxy S2, Galaxy Nexus, HTC Desire HD) sieht es prima aus, geht man aber in weit niedrigere Auflösungen sind die ImageViews total verschoben und zum Teil überlappend.

Gibt es da eine bessere Möglichkeit Bilder anzuzeigen, die sich je nach auflösung anpassen?

danke schonmal :)
 
hmm ich weiß zwar nicht ganz genau, was das problem ist, aber zeig mal deine layout files.
 
bilder sagen ja bekanntlich mehr als tausend worte :D
so soll es aussiehen (macht es auch bei den meisten):


so sieht es bei einigen wenigen aus (so in etwa):


hier mein code:

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" >

    <ImageView
        android:id="@+id/imageViewlongDrink"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:src="@drawable/imglongdrink"
        android:layout_marginRight="200dp"
        android:layout_marginBottom="380dp"
        android:onClick="wechsleActivity" />




    <ImageView
        android:id="@+id/imageViewBier"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:src="@drawable/imgbier"
        android:layout_marginLeft="190dp"
        android:layout_marginBottom="410dp"
        android:onClick="wechsleActivity" />


    <ImageView
        android:id="@+id/imageViewShot"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_alignRight="@+id/imageViewlongDrink"
        android:layout_marginTop="147dp"
        android:src="@drawable/imgshot"
        android:onClick="wechsleActivity" />

    <ImageView
        android:id="@+id/imageViewWout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/imageViewBiercontent"
        android:layout_alignParentTop="true"
        android:layout_marginLeft="200dp"
        android:layout_marginTop="150dp"
        android:layout_marginBottom="280dp"
        android:layout_alignParentRight="true"
        android:src="@drawable/imgwout"
        android:onClick="wechsleActivity" />



    <ImageView
        android:id="@+id/imageViewWine"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/imageViewShot"
        android:layout_marginBottom="150dp"
        android:layout_marginRight="240dp"
        android:layout_marginTop="40dp"
        android:src="@drawable/imgwine"
        android:onClick="wechsleActivity"
         />





    <ImageView
        android:id="@+id/imageViewOther"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:layout_alignTop="@+id/imageViewWout"
        android:layout_marginBottom="145dp"
        android:layout_marginRight="105dp"
        android:layout_marginLeft="100dp"
        android:layout_marginTop="100dp"
        android:src="@drawable/imgother"
        android:onClick="wechsleActivity" />


    <ImageView
        android:id="@+id/imageViewSettings"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/imageViewBiercontent"
        android:layout_alignParentRight="true"
        android:layout_alignTop="@+id/imageViewOther"
        android:src="@drawable/imgserttings"
        android:layout_marginLeft="250dp"
        android:layout_marginTop="10dp"
        android:layout_marginBottom="140dp"
        android:onClick="wechsleActivity" />




    <Button
        android:id="@+id/btnListe"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_marginBottom="18dp"
        android:layout_toLeftOf="@+id/btnCash"
        android:onClick="wechsleActivity"
        android:background="@drawable/lbtnliste" />


    <Button
        android:id="@+id/btnCash"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBaseline="@+id/btnListe"
        android:layout_alignBottom="@+id/btnListe"
        android:layout_alignLeft="@+id/imageViewBier"
        android:layout_alignParentRight="true"
        android:background="@drawable/lbtncash"
        android:onClick="wechsleActivity" />

</RelativeLayout>
 
naja

du hast bilder in der auflösung X

alle diese bilder werden mit wrap_content angezeigt, was ja heißt, dass sie soviel platz nehmen, wie sie brauchen.

wenn du jetzt einfach weniger platz hast, können nicht alle bilder in voller größe angezeigt werden.

du musst dazu einfach bilder in kleineren formate bereitstellen oder über die imageview skalieren lassen.
 
habs hinbekommen in dem ich die formate der bilder einfach einheitlich gemacht hab, danke :)
 

Ähnliche Themen

M
Antworten
10
Aufrufe
822
maksimilian
M
T
Antworten
0
Aufrufe
559
tim1602
T
Zurück
Oben Unten