Nachdem ich beim Rendern ein relatives Layout erstellt habe, habe ich festgestellt, dass unterhalb des Layouts Platz ist, der nicht benötigt wird. Ich habe sichergestellt, dass die Höhe der verwendeten Elemente ein Attribut wrap_content als Spezifikationsparameter für die Höhe hat. unten ist das SnippetSchließen Sie die Lücke im unteren Bereich eines relativen Layouts
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#338FD8D8">
<TextView
android:id="@+id/banner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center"
android:textSize="25sp"
android:padding="3px"
android:textColor="#000"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:orientation="horizontal">
<ImageView
android:id="@+id/logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.1"
android:layout_gravity="left"
android:src="@drawable/ic_launcher" />
<TextView
android:id="@+id/description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|right"
android:textSize="15sp"
android:padding="3px"
android:layout_marginRight="100px"
android:textColor="#000"/>
</LinearLayout>
</RelativeLayout>
Meine Herausforderung ist, wie kann ich die Lücken schließen, die
Warum machst du nicht 'layout_height = match_parent' für das äußerste' RelativeLayout'? Das wird sicherlich Ihre Lücke füllen – 0xDEADC0DE
hat es nicht funktioniert – blend
'es hat nicht funktioniert' ist nicht wirklich beschreibend. Hattest du immer noch die Lücke? Sind Sie auf ein anderes Layoutproblem gestoßen? Das Teilen einiger Screenshots könnte ebenfalls hilfreich sein – 0xDEADC0DE