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

coordinatelayout 툴바 오류..

0 추천

안녕하세요 ^^ 스크롤뷰 움직이는 방향에 따라 툴바가 생겨나고 없어지는걸 웹뷰상에서 작동하는걸 만들고 있습니다. 코드를 다 짜고 나니까 에뮬에서는 잘되더니 실제 폰에서는 툴바가 갑자기 사라지더군요; 일단 사진부터 보시면 

이런형태인데 위에 1,2 번째 사진은 에뮬인데 스크롤 움직임에 따라 잘 반응합니다;

근데 실제 핸드폰에선 앱실행할땐 툴바가 생기고 나서( 3번째사진) 갑자기 툴바를 포함한 화면전체를 웹뷰가 가려버립니다; 그리고 웹뷰 스크롤을 움직여도 툴바는 영원히 보이지 않았습니다.. 폰 버전은 4.4.2 입니다;

 

아래는 레이아웃 코드입니다

 

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/main_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

 


    <android.support.design.widget.AppBarLayout
        android:id="@+id/appbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
            app:layout_scrollFlags="scroll|enterAlways" />


    </android.support.design.widget.AppBarLayout>
    <android.support.v4.widget.DrawerLayout
        android:id="@+id/drawer_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".MainActivity"
        android:layout_below="@+id/toolbar">

    <android.support.v4.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/toolbar"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

<WebView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/WebView">

</WebView>

 

    </android.support.v4.widget.NestedScrollView>
        <RelativeLayout
            android:id="@+id/drawer"
            android:layout_width="300dp"
            android:layout_height="match_parent"
            android:layout_gravity="start"
            android:background="#ffffff"
            >
            <include
                android:layout_height="match_parent"
                android:layout_width="match_parent"
                layout="@layout/activity_list"/>
        </RelativeLayout>

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

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab_action"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="end|bottom"
        android:layout_margin="16dp"
        android:visibility="gone"
        />

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

 

대체 뭐가문제죠? ㅠㅠ 어서 완성시켜야 하는데.. 도와주세요..

껄껄앱 (1,910 포인트) 님이 2016년 3월 5일 질문
behavior 선언이 NestedScrollView 에 되어 있네요
behavior 는 차일드 뷰의 크기를 조정하니 DrawerLayout
에 behavior 주시고 테스트 해보세요

답변 달기

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