J'essaie d'obtenir mes commandes afin que j'affiche un contrôle qui a un bouton et une image qui occupe l'espace restant. Je cherchais à l'aide de poids, je peux l'obtenir pour travailler sur la largeur, mais dès que je l'utilise le poids sur rien de hauteur est affiché, mon code est le suivant:ANDROID linearlayout remplit l'espace restant en utilisant le poids
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:baselineAligned="true" android:weightSum="100">
<com.example.test.MyImageView
android:id="@+id/test_img"
android:layout_height="0dp"
android:layout_width="wrap_content"
android:layout_weight="75"
android:scaleType="fitCenter"
/>
<Button
android:id="@+id/RedrawBtn"
android:layout_height="0dp"
android:layout_width="wrap_content"
android:layout_weight="25"
android:text="Button" />
</LinearLayout>
</RelativeLayout>
S'il vous plaît voir ma réponse, il va résoudre votre problème. –