2017-01-05 1 views
1

툴바에 대한 작업이 있습니다. 스크롤 막대를 스크롤 할 때 숨겨 지지만 내용이 전화 화면보다 훨씬 크기 때문에 툴바를 숨기고 싶습니다. 그것은 말도 안돼. 어떻게해야합니까?스크롤시 도구 모음 축소 사용 안 함

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
      android:id="@+id/svCreateAdvert" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:fillViewport="true"> 

    <RelativeLayout 
     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:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:background="@color/grey" 
     android:orientation="vertical" 
     tools:context=".CreateAdvert"> 

     <LinearLayout 
      android:id="@+id/create_advert_container_toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="vertical"> 

      <android.support.v7.widget.Toolbar 
       android:id="@+id/createAdvertToolbar" 
       android:layout_width="match_parent" 
       android:layout_height="?attr/actionBarSize" 
       android:background="?attr/colorPrimary" 
       android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" 

       app:popupTheme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/> 
     </LinearLayout> 

     ... 

    </RelativeLayout> 
</ScrollView> 
+1

스크롤 막대 외부에 도구 막대를 놓으시겠습니까? –

답변

0

스크롤 막대 외부에 도구 막대를 배치하면 스크롤을 통해 도구 막대가 영향을받지 않습니다.

툴바 주위에 여분의 선형 배치를 추가해야합니다. & scrollview 이와 유사합니다.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/create_advert_container_toolbar" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:orientation="vertical"> 

    <android.support.v7.widget.Toolbar 
     android:id="@+id/createAdvertToolbar" 
     app:popupTheme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" 
     android:layout_width="match_parent" 
     android:layout_height="?attr/actionBarSize" 
     android:background="?attr/colorPrimary" 
     android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> 

    <ScrollView 
     android:id="@+id/svCreateAdvert" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:fillViewport="true"> 

     <RelativeLayout 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:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:background="@color/grey" 
      android:orientation="vertical" 
      tools:context=".CreateAdvert"> 

     </RelativeLayout> 
    </ScrollView> 
</LinearLayout> 
관련 문제