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

안드로이드 collapseMode에 대해 질문 하나만 하겠습니다.

0 추천

view

위 스크린 샷에서 보시면 리사이클러 뷰를 스크롤 하면 toolbar가 위로 숨는 액션을 처리하고 싶은데요.

collapseMode를 뷰 여기저기에 넣어보면서 실험해 봐도 올라가지를 않네요.

혹시 아시는 분 계신가요. layout은 아래와 같습니다.

 

<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/colorPrimary">


    <android.support.design.widget.AppBarLayout
        android:id="@+id/study_app_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fitsSystemWindows="true">

        <android.support.design.widget.CollapsingToolbarLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fitsSystemWindows="true"
            app:contentScrim="?attr/colorPrimary"
            app:layout_scrollFlags="scroll|exitUntilCollapsed">

            <android.support.v7.widget.Toolbar
                android:id="@+id/study_tool_bar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:layout_collapseMode="parallax"
                >

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

                    <TextView
                        android:id="@+id/study_tool_bar_title_txt"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:gravity="center"
                        android:paddingTop="5dp"
                        android:text="@string/app_name"
                        android:textColor="#ffffff"
                        android:textSize="20sp"
                        android:textStyle="bold"
                        />


                    <TextView
                        android:id="@+id/introduce_app_txt"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginBottom="5dp"
                        android:layout_marginLeft="1dp"
                        android:layout_marginRight="17dp"
                        android:layout_marginTop="5dp"
                        android:background="@drawable/rectangle_back"
                        android:elevation="2dp"
                        android:text="@string/introduce_app_txt"
                        android:textColor="#ffffff"/>

                </LinearLayout>
            </android.support.v7.widget.Toolbar>

        </android.support.design.widget.CollapsingToolbarLayout>
    </android.support.design.widget.AppBarLayout>

    <android.support.v7.widget.RecyclerView
        android:id="@+id/study_tab_recycler"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/study_app_bar"
        android:layout_marginTop="2dp"
        android:layout_marginBottom="90dp"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

    </android.support.v7.widget.RecyclerView>
</android.support.design.widget.CoordinatorLayout>


준버기 (1,160 포인트) 님이 2017년 12월 12일 질문

답변 달기

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