마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

안드로이드 layout weightSum 과 weight 문의 [closed]

0 추천
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/LinearLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:weightSum="10" >

    <LinearLayout 
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:orientation="vertical"        
        android:layout_weight="6"
        android:weightSum="10"
        >

        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="match_parent"            
            android:layout_weight="2" />

        <ImageView
            android:id="@+id/imageView2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="4" />

        <ImageButton
            android:id="@+id/imageButton1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@null"
            android:layout_weight="4" />        
    </LinearLayout>
    <LinearLayout 
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:orientation="horizontal"
        android:layout_weight="2"
        android:weightSum="8">

        <ImageButton
            android:id="@+id/imageButton2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="2" />

        <ImageButton
            android:id="@+id/imageButton3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="2" />
        <ImageButton
            android:id="@+id/imageButton4"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="2" />

        <ImageButton
            android:id="@+id/imageButton5"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="2" />
        
    </LinearLayout>
    
    <LinearLayout 
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:orientation="horizontal"
        android:layout_weight="2"
        android:weightSum="8">

        <ImageButton
            android:id="@+id/imageButton2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="2" />

        <ImageButton
            android:id="@+id/imageButton3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="2" />
        <ImageButton
            android:id="@+id/imageButton4"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="2" />

        <ImageButton
            android:id="@+id/imageButton5"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="2" />
        
    </LinearLayout>
        
    
</LinearLayout>

이런식으로 메인레이아웃을 짜려고 하는데요 weight 부분에서 계속 문제가 생기네요.

weightSum 값과 weight 값을 같이 줘서 이런 문제가 생기나요 ?

큰틀의 뷰그룹 부분은 안에 내용물이 딱맞게 됫으나 밑에 이미지 버튼으로 달려고 하는 작은 네모들이

parent 의 height 값에 딱 크기가 안맞아 떨어지는부분이 문제 입니다.


레이아웃 부분입니다.

발그림 죄송합니다.. 이런식의 레이아웃을 잡고 싶은 건데 잘 안되네요 

혹시 이런부분 해결해보신분 계시면 도움좀 주세요 ㅠ

질문을 종료한 이유: 문제가 해결되었습니다.
구기웅 (1,110 포인트) 님이 2013년 7월 24일 질문
구기웅님이 2013년 7월 24일 closed
...