<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

        CollapsingToolbarLayout with a ViewPager(带有 ViewPager 的 CollapsingToolbarLayout)
        <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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How can I use CClistview in COCOS2d Android?(如何在 COCOS2d Android 中使用 CClistview?)
                  cocos2d-android: how to display score(cocos2d-android:如何显示分数)
                  Sqlite database not copied from asset folder Android(Sqlite 数据库未从资产文件夹 Android 复制)
                  SQLite Database Copy Appears Corrupted When Generated by Device and not Emulator(SQLite 数据库副本在由设备而不是模拟器生成时出现损坏)
                  Android file copy(安卓文件拷贝)
                  Android how to detect Copy event of Edittext in android(Android如何在android中检测Edittext的Copy事件)
                  <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'>

                            <tbody id='cfgAe'></tbody>