J'ai actuellement un imageview
avec une image. Il semble parfait sur mon écran de test 2.7 ", cependant, quand je le tester sur mon écran 4.3", l'image n'est pas là où elle devrait être. Je règle la taille pour avoir dp
et j'ai mon dossier d'image dans les dossiers de hdpi, de mdpi, et de Ldpi. Est-ce que je fais quelque chose de mal? Ou plutôt, existe-t-il un moyen de verrouiller la place de l'image pour qu'elle s'affiche de la même manière dans toutes les tailles de téléphone? Merci.Android- Ajuster l'image pour différentes tailles d'écran
Le imageview
qui ne s'adapte à différentes tailles d'écran est le premier imageview
(id = sdrbg) voici mon fichier de mise en page:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/relativeLayout1" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:orientation="vertical">
<ImageView android:layout_width="wrap_content"
android:layout_alignParentTop="true" android:id="@+id/sdrbg"
android:background="@drawable/sdrmaingraphic" android:layout_height="289dp"></ImageView>
<ImageView android:id="@+id/canvasBOM"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="false" android:layout_width="fill_parent"
android:background="@drawable/canvas" android:layout_height="100dp">
</ImageView>
<Button android:layout_alignParentBottom="true"
android:id="@+id/playpausebuttonBOM" android:background="@drawable/main_pause_button"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:layout_marginLeft="10dp"></Button>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/nextbuttonBOM"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true" android:background="@drawable/next_song_button"
android:layout_marginRight="10dp"></Button>
<TextView android:id="@+id/textView1" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:text="Best of May 2011"
android:textSize="20dp" android:textStyle="bold"
android:layout_centerHorizontal="true" android:layout_centerVertical="false"></TextView>
</RelativeLayout>
De nombreux facteurs influencent la disposition et la taille d'un ImageView. Êtes-vous en mesure de partager le fichier de mise en page? –
@Dan: vient d'ajouter mon code de disposition – Splitusa