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

안녕하세요 drawerlayout 에대해 질문합니다.

0 추천

안녕하세요 저는 아직 경력이 1년도안된 초보 안드로이드 개발자 입니다.

 

이것저것 해보고 있는 과정에서 피키캐스트를 모티브로한 저만의 프로젝트를 만들어 보려고 하는데요

피키캐스트 메인 화면 처럼 메뉴 버튼을 누르면 드로워 레이아웃이 보이게끔 만들고 싶습니다.

일단 드로워 레이아웃 구현은 구글링을 통하여 성공 하였습니다

여기서 질문 드리겠습니다.

피키캐스트앱을 보면 가장 상단에 피키캐스트 로고가 있고 좌우로 메뉴버튼과 서치 버튼

그아래로 이미지뷰와 리스트뷰를 이용한 이미지뷰/텍스트뷰 로 구성 되어 있는걸 확인할수 있었습니다.

정말 궁금한점은 xml 창에서 어떻게 구현해야하는지.. 이방법을 모르겠습니다.

 

ex)이소스에서 어떤부분에 drawerlayout 이 들어가야하는지 이것저것 해본결과 drawerlayout 은

한 액티비티에서 메인부분과 drawer 해서 보여질 부분을 구현 하는것 같은데 도저히 방법을 모르겟습니다..

피키캐스트 메인화면처럼 깔끔하게 만들기 위해서는 어떤 작업을 해야할가요..

조언좀 부탁드립니다!

<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:layout_width="match_parent"
        android:layout_height="40dp"
        android:orientation="vertical" >

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="565dp" >
           
            <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
           

            <Button
                android:id="@+id/button1"
                style="?android:attr/buttonStyleSmall"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_alignParentTop="true"
                android:text="menu" />

            <Button
                android:id="@+id/button2"
                style="?android:attr/buttonStyleSmall"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_alignParentTop="true"
                android:text="search" />

            <TextView
                android:id="@+id/textView1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignBaseline="@+id/button2"
                android:layout_alignBottom="@+id/button2"
                android:layout_centerHorizontal="true"
                android:text="Blessing"
                android:textAppearance="?android:attr/textAppearanceLarge" />

        </RelativeLayout>

    </LinearLayout>

</LinearLayout>

줴훈줴훈 (290 포인트) 님이 2015년 11월 6일 질문

답변 달기

· 글에 소스 코드 보기 좋게 넣는 법
· 질문에 대해 추가적인 질문이나 의견이 있으면 답변이 아니라 댓글로 달아주시기 바랍니다.
표시할 이름 (옵션):
개인정보: 당신의 이메일은 이 알림을 보내는데만 사용됩니다.
스팸 차단 검사:
스팸 검사를 다시 받지 않으려면 로그인하거나 혹은 가입 하세요.
...