Android - Deux ImageViews side-by-side

Je suis en train de créer une Activité pour une application Android avec deux imageViews alignés côte-à-côte. ma configuration actuelle config est la suivante:

<LinearLayout android:orientation="horizontal"
    android:layout_width="fill_parent" android:layout_height="wrap_content"
    android:paddingTop="15dip" android:paddingBottom="15dip"
    android:background="@drawable/dark_bg">

    <ImageView android:id="@+id/numberDays"  
        android:layout_width="wrap_content" android:layout_height="wrap_content"
        android:scaleType="fitStart"
        android:src="@drawable/counter_01" />
    <ImageView android:src="@drawable/counter_days" 
        android:layout_height="wrap_content" android:layout_width="wrap_content"
        android:scaleType="fitStart" 
        android:id="@+id/daysText"></ImageView>

</LinearLayout>

La première image sera un carré (disons 100x100) et la deuxième image est rectangulaire (300x100) - et je veux qu'ils soient alignées les unes à côté des autres, mais toujours être mis à l'échelle pour s'adapter à la largeur de l'appareil - c'est possible seulement avec la mise en page de config?

La config actuelle montre juste la première image de la totalité de la largeur (et presque à la hauteur) de l'écran et la seconde image n'est pas du tout visible. J'ai essayé de changer wrap_content avec fill_parent et hardocding largeurs, mais qui a seulement abouti dans les deux images, mais la première image sur le dessus de la seconde image (à la fois ancré à gauche).

Grâce


DE NOUVEAU MIS À JOUR:

J'ai mis à jour ma mise en page ressemble à ceci maintenant, y compris le ScrollView comme recommandé, mais pas de joie:

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

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:gravity="top"
    android:layout_width="fill_parent" android:layout_height="fill_parent" >

<!-- Header for activity - this has the countdown in it -->
<ScrollView android:id="@+id/ScrollView01" android:layout_height="wrap_content" android:layout_width="fill_parent">
    <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content"
        android:gravity="right"
        android:background="@drawable/dark_bg" android:orientation="horizontal">

        <ImageView android:id="@+id/numberDays"  
            android:layout_width="wrap_content" android:layout_height="wrap_content"
            android:layout_weight="2"
            android:src="@drawable/counter_01" />

        <ImageView android:src="@drawable/counter_days" 
            android:layout_width="wrap_content" android:layout_height="wrap_content"
            android:layout_weight="1" 
            android:id="@+id/daysText"/>

    </LinearLayout>

</ScrollView>


<!--  main body for the rest of the info -->
    <LinearLayout android:orientation="horizontal" android:gravity="center"
        android:layout_width="fill_parent" android:layout_height="fill_parent"
        android:background="@drawable/light_bg">
    </LinearLayout>

</LinearLayout>

À l'aide de la layout_weight comme le suggère a donné à la fois les images de la droite ratios et semblent être mis à l'échelle parfaitement, cependant, j'ai toujours le problème de laquelle ils sont à la fois ancré à l'extrême gauche de l'écran, de sorte que la première image est en fait placée au-dessus de la seconde image, plutôt que d'avoir côte à côte.

Ci-dessous est une capture d'écran de l'Éclipse d'affichage:

Android - Deux ImageViews side-by-side

OriginalL'auteur rhinds | 2011-06-02