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

Layout weightSum과 weight 때문에 고생입니다.ㅠ

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"
        android:background="#007700"
        >        
        <ImageView
            android:id="@+id/title_img_view"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:background="#0fffff" />        

        <ImageView
            android:id="@+id/top_img_view"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="6"
            android:background="#000055" />

        <ImageButton
            android:id="@+id/top_img_btn"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"            
            android:background="#ffff00"
            android:layout_weight="3" />        
    </LinearLayout>
    <LinearLayout 
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:orientation="horizontal"
        android:layout_weight="3"        
        android:weightSum="8"
        android:layout_margin="0dp">

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

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

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

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

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

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

하단부 부분에 리니어레이아웃으로 잡고 이미지버튼을 준부분만 레이아웃의 horizontal 때문인건지 모르겠지만.

버튼부분사이가 계속 padding 효과가 들어간거 같습니다. 혹시 이부분의 문제점을 아시나요 ?

아니면 weight값을 다 이제 주면 안되고 디바이스 마다 display통해서 비트맵을 늘리고 뿌려줘야 하나요 ?ㅠ

구기웅 (1,110 포인트) 님이 2013년 7월 25일 질문

1개의 답변

0 추천
버튼 기본이미지에 빈 영역이 들어가 있습니다..

빈 영역이 없는 버튼 이미지를 만들어서 사용하세요
루지메이앙 (3,450 포인트) 님이 2013년 7월 25일 답변
댓글 감사합니다. 버튼안에 이미지를 넣을려고 하는건데요
지금 말씀 하신부분은 버튼 기본 속성중에 이미 빈영역이 잡혀있다고 하시는거 같은데요 이미지를 넣게 되면 바뀐다는 말씀 이신가요 ??
...