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

Layout 컨트롤 도와주세요 ..

0 추천

맨위는 일반 imageView 사진을 넣을 거구요

빨간색 배경은 그리드 뷰로 넣고

맨아래는 imageButton 으로 구성하고 싶은데 생각대로 잘 되지 않습니다.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/mLayout"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@color/bg"
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/Viewimage"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
    
    <GridView 
        android:layout_width="wrap_content"
	    android:layout_height="wrap_content"
        >
    </GridView>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >

        <Button
            android:id="@+id/EditBtn"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent" />

        <Button
            android:id="@+id/CropBtn"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent" />

        <Button
            android:id="@+id/ChangeBtn"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent" />
    </LinearLayout>

</LinearLayout>

 

버튼이 맨아래 안붙는데요 ㅠㅠ

위에 있는 것처럼 구성 해보고 싶은데 맞추기가 쉽지 않네요 ... 도와주세요

 

이렇게 되어 버려요 ㅠㅜ

바밥 (420 포인트) 님이 2015년 5월 14일 질문
바밥님이 2015년 5월 15일 수정

2개의 답변

0 추천
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/mLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/bg"
    android:orientation="vertical" >
 
    <ImageView
        android:id="@+id/Viewimage"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
     
    <GridView 
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>
 
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >
 
        <ImageButton
            android:id="@+id/EditBtn"
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_height="match_parent" />
 
        <ImageButton
            android:id="@+id/CropBtn"
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_height="match_parent" />
 
        <ImageButton
            android:id="@+id/ChangeBtn"
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_height="match_parent" />
    </LinearLayout>
 
</LinearLayout>

 

image button의 height는 wrap_content로 해야할지도 모르겠네요 

---------------------------- 수정 -------------------

정확히 뭐가 어떻게 안된다는건지 모르겠지만, 

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/mLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/bg"
    android:orientation="vertical" >
 
    <ImageView
        android:id="@+id/Viewimage"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
     
    <GridView 
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"/>
 
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >
 
        <ImageButton
            android:id="@+id/EditBtn"
            android:layout_width="20dp"
            android:layout_height="20dp" />
 
        <ImageButton
            android:id="@+id/CropBtn"
            android:layout_width="20dp"
            android:layout_height="20dp" />
 
        <ImageButton
            android:id="@+id/ChangeBtn"
            android:layout_width="20dp"
            android:layout_height="20dp" />
    </LinearLayout>
 
</LinearLayout>

 

쎄미 (162,410 포인트) 님이 2015년 5월 14일 답변
쎄미님이 2015년 5월 15일 수정
<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >
버튼은 아래로 안붙는데욥 ㅠㅠ
만드실 환경에 따라 방법이 너무 많은데...
html footer처럼 버튼 모음 LinearLayout 을 맨아래에 착 달라붙게 못하나요 ... 고정으로
하나의 해상도에만 맞추실껀가요?
여러개에 맞춰야 할 것 같습니다
0 추천
뭐가 어떻게 안되는지 자세하게 설명해 주세요~
작전동 (5,890 포인트) 님이 2015년 5월 14일 답변
레이아웃이 조절이 안되네요 ...
...