2014-05-14 5 views
0

다른 여러 어린이 (다른 레이아웃, 이미지 뷰 및 버튼)와 RelativeLayout이 있습니다.RelativeLayout을 화면에 정확하게 표시합니다.

모든 내부 레이아웃/뷰가 해당 RelativeLayout에 맞게 조정됩니다. 이 RelativeLayout이 화면을 정확히 채우도록 할 수 있습니까?

편집 : 내 레이아웃 :

<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> 

편집 2 : 내가 동적 BTW 이미지 뷰를 설정하고있다.

+0

xml 파일을 여기에 표시하십시오. – Piyush

+0

@PiYusH GuPtA 방금 전에 : – deimos1988

+0

XML에 따르면 부모 인 RelativeLayout이 전체 화면을 채 웁니다. – Leandros

답변

0

xml 레이아웃 파일에서 RelativeLayout의 layoutWidthlayoutHeight 속성을 match_parent으로 설정 했습니까?

+0

예, 불행히도 도움이되지 않았습니다. RelativeLayout에서 다음 자식으로 ScrollView도 있습니다. 문제가 될 수 있습니까? – deimos1988

+0

xml 레이아웃을 게시 할 수 있습니까? –

+0

방금 ​​추가했습니다. – deimos1988

관련 문제