<small id='SFswX'></small><noframes id='SFswX'>

  • <legend id='SFswX'><style id='SFswX'><dir id='SFswX'><q id='SFswX'></q></dir></style></legend>

  • <i id='SFswX'><tr id='SFswX'><dt id='SFswX'><q id='SFswX'><span id='SFswX'><b id='SFswX'><form id='SFswX'><ins id='SFswX'></ins><ul id='SFswX'></ul><sub id='SFswX'></sub></form><legend id='SFswX'></legend><bdo id='SFswX'><pre id='SFswX'><center id='SFswX'></center></pre></bdo></b><th id='SFswX'></th></span></q></dt></tr></i><div id='SFswX'><tfoot id='SFswX'></tfoot><dl id='SFswX'><fieldset id='SFswX'></fieldset></dl></div>
    1. <tfoot id='SFswX'></tfoot>
      • <bdo id='SFswX'></bdo><ul id='SFswX'></ul>

        带有 ViewPager 的 CollapsingToolbarLayout

        时间:2023-10-04
        <tfoot id='celKa'></tfoot>
          <bdo id='celKa'></bdo><ul id='celKa'></ul>

          1. <small id='celKa'></small><noframes id='celKa'>

              <legend id='celKa'><style id='celKa'><dir id='celKa'><q id='celKa'></q></dir></style></legend>
                1. <i id='celKa'><tr id='celKa'><dt id='celKa'><q id='celKa'><span id='celKa'><b id='celKa'><form id='celKa'><ins id='celKa'></ins><ul id='celKa'></ul><sub id='celKa'></sub></form><legend id='celKa'></legend><bdo id='celKa'><pre id='celKa'><center id='celKa'></center></pre></bdo></b><th id='celKa'></th></span></q></dt></tr></i><div id='celKa'><tfoot id='celKa'></tfoot><dl id='celKa'><fieldset id='celKa'></fieldset></dl></div>
                    <tbody id='celKa'></tbody>

                  本文介绍了带有 ViewPager 的 CollapsingToolbarLayout的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试使用 CollapsingToolbarLayout 来创建一个带有 ViewPager 的可折叠工具栏,该工具栏在向上滚动时会消失,但如果 ViewPager 存在,我似乎无法向上滚动.

                  I'm trying to use the CollapsingToolbarLayout to have a collapsible toolbar with a ViewPager that fades away while scrolling up but I seem to lose the ability to scroll up if the ViewPager is present.

                  ViewPager 应该在工具栏中显示多个图像.

                  The ViewPager is supposed to show multiple images in the Toolbar.

                  这是 XML:

                  <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:fitsSystemWindows="true">
                  
                      <android.support.design.widget.AppBarLayout
                          android:id="@+id/app_bar_layout"
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
                          android:fitsSystemWindows="true">
                  
                          <android.support.design.widget.CollapsingToolbarLayout
                              android:id="@+id/collapsing_toolbar"
                              android:layout_width="match_parent"
                              android:layout_height="match_parent"
                              app:layout_scrollFlags="scroll|exitUntilCollapsed"
                              app:contentScrim="?attr/colorPrimary"
                              android:fitsSystemWindows="true">
                  
                              <android.support.v4.view.ViewPager
                                  android:id="@+id/pager"
                                  android:layout_width="match_parent"
                                  android:layout_height="wrap_content"
                                  app:layout_collapseMode="parallax"
                                  android:fitsSystemWindows="true">
                              </android.support.v4.view.ViewPager>
                  
                              <android.support.v7.widget.Toolbar
                                  android:id="@+id/toolbar"
                                  android:layout_width="match_parent"
                                  android:layout_height="?attr/actionBarSize"
                                  app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
                                  app:layout_collapseMode="pin" />
                  
                          </android.support.design.widget.CollapsingToolbarLayout>
                  
                      </android.support.design.widget.AppBarLayout>
                  
                      <android.support.v4.widget.NestedScrollView
                          android:id="@+id/scroll"
                          android:layout_width="match_parent"
                          android:layout_height="match_parent"
                          android:clipToPadding="false"
                          app:layout_behavior="@string/appbar_scrolling_view_behavior">
                  
                          <!-- Content -->
                  
                      </android.support.v4.widget.NestedScrollView>
                  
                  </android.support.design.widget.CoordinatorLayout>
                  

                  推荐答案

                  我设法通过将 ViewPager 的高度设置为固定大小来解决这个问题.似乎 wrap_content 不考虑图像大小.

                  I managed to fix this by setting the ViewPager's height to a fixed size. It seems that wrap_content doesn't regardless of the image size.

                  这篇关于带有 ViewPager 的 CollapsingToolbarLayout的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何从 viewpager 和 pageradapter 中删除项目 下一篇:使用 ActionBarSherlock &amp;ViewPagerIndicator 同步不会编译

                  相关文章

                  <legend id='cfgAe'><style id='cfgAe'><dir id='cfgAe'><q id='cfgAe'></q></dir></style></legend>
                2. <tfoot id='cfgAe'></tfoot>
                      <bdo id='cfgAe'></bdo><ul id='cfgAe'></ul>
                    <i id='cfgAe'><tr id='cfgAe'><dt id='cfgAe'><q id='cfgAe'><span id='cfgAe'><b id='cfgAe'><form id='cfgAe'><ins id='cfgAe'></ins><ul id='cfgAe'></ul><sub id='cfgAe'></sub></form><legend id='cfgAe'></legend><bdo id='cfgAe'><pre id='cfgAe'><center id='cfgAe'></center></pre></bdo></b><th id='cfgAe'></th></span></q></dt></tr></i><div id='cfgAe'><tfoot id='cfgAe'></tfoot><dl id='cfgAe'><fieldset id='cfgAe'></fieldset></dl></div>

                    <small id='cfgAe'></small><noframes id='cfgAe'>