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

CoordinatorLayout 질문입니다!!

0 추천

<?xml version="1.0" encoding="utf-8"?>

<android.support.design.widget.CoordinatorLayout 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"

    xmlns:app="http://schemas.android.com/apk/res-auto"

    tools:context="com.example.MainActivity">

    <android.support.v4.widget.NestedScrollView

        android:layout_width="match_parent"

        android:layout_height="match_parent">

        <android.support.v7.widget.RecyclerView

            android:id="@+id/list_item"

            android:layout_width="match_parent"

            android:layout_height="wrap_content" />

    </android.support.v4.widget.NestedScrollView>

    <android.support.design.widget.AppBarLayout

        android:layout_width="match_parent"

        android:layout_height="wrap_content">

    <android.support.design.widget.CollapsingToolbarLayout

        android:layout_width="match_parent"

        android:layout_height="wrap_content">

        <android.support.v7.widget.Toolbar

            android:id="@+id/Top_bar"

            android:layout_width="match_parent"

            android:layout_height="wrap_content"

            android:background="@color/colorPrimary">

            <ImageView

                android:id="@+id/Logo"

                android:layout_width="wrap_content"

                android:layout_height="match_parent"

                android:layout_gravity="left"

                android:scaleType="fitCenter"

                android:src="@drawable/logo" />

            <ImageButton

                android:layout_width="wrap_content"

                android:layout_height="match_parent"

                android:layout_gravity="right"

                android:src="@drawable/talk" />

            <ImageButton

                android:id="@+id/search_bar"

                android:layout_width="wrap_content"

                android:layout_height="match_parent"

                android:layout_gravity="right"

                android:src="@drawable/search" />

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

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

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

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

 

Coordinatorlayout에서 RecylcerView가 나오기전에 autoscrollviewpager와 GridLayout이 보여지고 그다음에 RecyclerView가 보이게 하고, 다시 맨위로 스크롤 올리면 autoscrollviewpager와 GridLayout이 보이게 하고 싶은데,
어느 부분에 autoscrollviewpager와 GridLayout를 넣어야되나요..?ㅠㅠ

꿀개 (2,440 포인트) 님이 2019년 7월 17일 질문

1개의 답변

0 추천
 
채택된 답변

CollapsingToolbarLayout에 Toolbar와 같은 레벨로 위치시킨다음

collapseType? mode?그거를 넣어주면 됩니다

그리고 NestedScrollView는 없애고 RecyclerView에 scrollBehavior를 선언해주시면 됩니다.

 

Bateaux (5,200 포인트) 님이 2019년 7월 20일 답변
꿀개님이 2019년 7월 22일 채택됨
...