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

질문이요!! 레이아웃 분할후에요..

0 추천
=========
--------------

layout1

--------------

layout2
 
--------------
=========

이렇게 레이아웃두개가 있고 화면 우측에

슬라이딩드로어 하나를 만들려면 어떻게 해야하나요??

각각의 레이아웃에 하나씩 넣는거 밖에 못하겠네요; 도와주세요..
익명사용자 님이 2013년 4월 7일 질문

1개의 답변

+1 추천

여러가지 방법이 있겠습니다만.

레이아웃을 다음과 같이 구성하여 보았어요. 

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal"
    tools:context=".MainActivity" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:orientation="vertical" 
        >
	    <!-- 왼쪽 상단 레이아웃 -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:orientation="vertical" 
            android:background="#555555">
        </LinearLayout>
	    <!-- 왼쪽 하단 레이아웃 -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:orientation="vertical" 
            android:background="#ffffff">
        </LinearLayout>

    </LinearLayout>
    
<!-- 오른쪽 레이아웃   이 레이아웃 아래 슬라이딩 드로어 구현 -->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:orientation="vertical" 
        android:background="#000000">
    </LinearLayout>

</LinearLayout>

참고하세용.

아래는 다른 구성으로 이해한 레이아웃 입니다.

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >

        <!--  상단 레이아웃 -->

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:background="#555555"
            android:orientation="vertical" >
        </LinearLayout>
        <!-- 하단 레이아웃 -->

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:background="#ffffff"
            android:orientation="vertical" >
        </LinearLayout>
    </LinearLayout>

      <!-- 오른쪽 레이아웃  -->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal" >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:background="#00000000"
            android:orientation="vertical" >
        </LinearLayout>

        <!-- 슬라이딩 드러어 구현 레이아웃  -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:background="#ffffff"
            android:orientation="vertical" >
        </LinearLayout>
    </LinearLayout>

</FrameLayout>

두게 중 어떤 것이 원하시는 것인지 모르겠네요 ㅎ

아니면 댓글 달아주세요.

앙드로이등 (850 포인트) 님이 2013년 4월 8일 답변
앙드로이등님이 2013년 4월 8일 수정
...