2017-06-08 5 views
-1

Ich möchte Bild ca. volle Höhe und eine feste Fußzeile platzieren. Ich habe diesen Code ausprobiert. dynamisch Bild wird aktualisiert die Galerie mitPlace Bildansicht mit fester Fußzeile Android

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context="com.aaaa.com.EditView"> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:orientation="horizontal" 
     tools:layout_editor_absoluteY="0dp" 
     tools:layout_editor_absoluteX="8dp" 
     android:layout_alignParentBottom="true" 
     android:id="@+id/footerEdit" 
     android:weightSum="2"> 

     <Button 
      android:id="@+id/addBackground" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:background="@drawable/icon_content" /> 

     <Button 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:id="@+id/takePhoto" 
      android:background="@drawable/icon_camera"/> 

    </LinearLayout> 

    <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 
     <ImageView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:id="@+id/imgview"/> 
    </RelativeLayout> 

I Bild gesamten Bildschirm skalieren mag aber Fußbereich Bitte führen

Antwort

1

verlassen Wenn Sie mit relativen Layouts arbeiten, können Sie immer noch Kopf verwalten und Fußzeile (diese letzte für Sie), die zwischen den Layouts anzeigt und anordnet. Für Ihre Hauptinhaltsbereich hinzufügen:

android:layout_above="@id/lytFooter" 

setzen über Ihre Fußzeile gestapelt werden und

android:layout_below="@id/lytHeader" 

auf unter Ihrem Kopf gestapelt eingestellt werden.

Legen Sie für Ihren Hauptinhaltsbereich height auf match_parent fest.

Ich hoffe, es hilft.

Verwandte Themen