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

레이아웃 꽉 채우고싶은데 조금 남아요 ㅠㅠ

0 추천

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <LinearLayout
        android:id="@+id/Intent_memo"
        android:layout_width="fill_parent"
        android:layout_height="170dp"
        android:onClick="onClick"
        android:background="@drawable/bg_memo1"
        android:orientation="vertical" >
    </LinearLayout>
    <LinearLayout
        android:id="@+id/Intent_picture"
        android:layout_width="fill_parent"
        android:layout_height="170dp"
        android:onClick="onClick"
        android:background="@drawable/bg_picture1"
        android:orientation="vertical" >
    </LinearLayout>

    <LinearLayout
        android:id="@+id/Intent_bg"
        android:layout_width="fill_parent"
        android:layout_height="170dp"
        android:onClick="onClick"
        android:background="@drawable/bg_pg"
        android:orientation="vertical" >
    </LinearLayout>

</LinearLayout>

 

위 소스로 하면 아래처럼 나와요ㅠㅠ

 

 

빈부분을 어떻게해야할가요ㅠㅠ

꽉 채우고 싶습니다 ㅠ

 

이클립스에서는 저렇게 안나오고 꽉채워져있는데 스마트폰으로보니 다르게나와요.

성수소년 (550 포인트) 님이 2015년 10월 15일 질문

1개의 답변

0 추천
 
채택된 답변
높이가 각각 170dp로 되어있기 때문에 제목 등을 포함해서 600dp 정도의 단말에서는 꽉 차게 보일 수 있겠지만 그 이상의 단말에서는 빈 부분이 발생할 수 있습니다

그런거 신경쓰지 않으려면 각각의 레이아웃에 weight를 주세요. 리니어 레이아웃에서만 가능한데 올려주신 레이아웃은 리니어네요.

높이는 0dp로 설정하고 weight를 1씩 주면 3등분해서 빈 곳 없이 출력될 겁니다
cc1232 (35,280 포인트) 님이 2015년 10월 15일 답변
성수소년님이 2015년 10월 16일 채택됨
감사합니다! 해결됬습니다.
...