2014-05-14 2 views
0

J'ai un RelativeLayout avec plusieurs autres enfants (autres Layouts, images vues et boutons). Toutes les dispositions/vues intérieures s'adaptent au RelativeLayout en question.Faire un RelativeLayout remplir l'écran exactement

Puis-je faire en sorte que RelativeLayout remplisse l'écran exactement?

EDIT: Ma mise en page:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:id="@+id/container" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:gravity="center_vertical|center_horizontal" 
    android:layout_gravity="center_vertical" > 

<ScrollView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" > 

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:layout_gravity="center_vertical" 
    android:gravity="center_vertical" 
    android:orientation="vertical" > 

<RelativeLayout 
    android:id="@+id/start_activity_relLayout_container" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:layout_above="@+id/start_activity_relLayout_container_bottom" 
    android:gravity="center_horizontal" 
    android:layout_gravity="center_vertical" > 

<RelativeLayout 
    android:id="@+id/relLayout_dialogfragment_image" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_below="@+id/linLayout_imageview_container" 
    android:gravity="center_vertical" > 

    <ImageView 
     android:id="@+id/image" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@drawable/tutorial_thirdview" 
     android:text="@string/button_servicerequirement" /> 

</RelativeLayout> 
</RelativeLayout> 

    <RelativeLayout 
    android:id="@+id/start_activity_relLayout_container_bottom" 
    android:layout_width="match_parent" 
    android:layout_height="30dp" 
    android:layout_marginTop="@dimen/two"> 

    <LinearLayout 
    android:id="@+id/linearLayout1" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_centerHorizontal="true"> 

    <Button 
     android:id="@+id/image_cancel" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="@string/button_cancel" 
     style="@style/button_standard_bright_smaller" 
     android:layout_marginRight="3dp"/> 
    <Button 
     android:id="@+id/image_ok" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="@string/button_ok" 
     android:layout_marginLeft="3dp"/> 
     </LinearLayout> 
    </RelativeLayout> 
    </LinearLayout> 
</ScrollView> 
</RelativeLayout> 

EDIT 2: Je suis en train de l'imageview dynamique btw.

+0

Afficher votre fichier XML ici – Piyush

+0

@PiYusH GuPtA Je viens de le faire :) – deimos1988

+0

Selon votre xml, le parent 'RelativeLayout' remplit tout l'écran. – Leandros

Répondre

0

Avez-vous essayé de paramétrer les propriétés layoutWidth et layoutHeight de RelativeLayout sur match_parent dans votre fichier de mise en page XML?

+0

Oui, malheureusement cela n'a pas aidé. J'ai aussi un ScrollView comme le prochain enfant dans le RelativeLayout - pourrait-il être le problème? – deimos1988

+0

pourriez-vous poster votre mise en page xml? –

+0

Je viens de l'ajouter :) – deimos1988

Questions connexes