- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我知道需要一个工具栏,以便在您滚动时 CollapsingToolbarLayout 不会完全关闭:例如:
http://imgur.com/zQxi1Y8
我试图弄清楚我是否可以在没有工具栏的情况下摆脱 CollapsingToolbarLayout 并且仍然不会完全关闭?
这是我的代码:
<?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"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/annonce.main.coordinator"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:ignore="RtlHardcoded">
<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.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing"
android:layout_width="match_parent"
android:layout_height="300dp"
app:title="Paky youuu"
app:expandedTitleMarginBottom="94dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:contentScrim="?colorPrimary">
<TextView
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:text="Nooo, don't close!"
android:background="@null"
app:layout_collapseMode="pin"
style="@style/ToolBarWithNavigationBack"/>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:id="@+id/linear_anchor"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
android:lineSpacingExtra="6dp"
/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="32dp"
android:elevation="8dp"
android:src="@drawable/vector_ic_alarm_24dp"
app:layout_anchor="@id/linear_anchor"
app:layout_anchorGravity="top|right|end"
tools:ignore="RtlHardcoded" />
</android.support.design.widget.CoordinatorLayout>
最佳答案
将 minHeight 设置为 CollapsingToolbarLayout 就完成了。
关于没有Toolbar的Android CollapsingToolbarLayout停在某个点而不是完全关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36724026/
我指的是 Cheesesquare app.我目前的设计要求略有不同.. 像这样的(忽略图片和名称下面的部分) 我想要圆形图像右下角的 float 操作按钮和它下面的人的名字(这将是 Collapsi
我在给定 ScrollingActivity 的 Android Studio 中的 CollapsingToolbarLayout 有问题。 向下滚动 Action 完美无缺,但当我想向上滚动时,它
我正在尝试将包含 ImageView 按钮和其他 UI 元素的 LinearLayout 放置在 CollapsingToolbarLayout 中,这可能吗? 最佳答案 CollapsingTool
我正在使用 CollapsingToolbarLayout 和一个 viewpager。 Viewpager 由 RecyclerView 组成。但是,当滚动回收器 View 时,工具栏不会折叠。 a
我正在尝试控制 collpasingtoolbarlayout 的快照滚动标志的滚动行为。按照这个教程linkSCROLL_FLAG_SNAP:在滚动结束时,如果 View 只是部分可见,那么它将被捕
我正在为我的 fragment (选项卡)使用 CollapsingToolbarLayout 和 View 页面。
如果我将依赖项从 23.1.1 更新到 23.2.0,CollapsingToolbarLayout 将无法正常工作。应用崩溃并抛出错误。 java.lang.RuntimeException:and
在我的 CoordinatorLayout 中,我有以下安排: 我希望我的自定义 T
我在使用 Android 设计支持库时发现我的应用程序存在问题,因为 CollapsingToolbarLayout 顶部似乎有一个主题色背景栏,即使有足够的空间(因此它应该是“透明的” '). 知道
我开始在我的应用中使用折叠工具栏。按照他们在 Android 开发人员博客上的方式实现后,它似乎无法正常工作。我看到溢出和向上导航按钮,但是当我向下滚动时它们不跟随工具栏。这video这是应该发生的事
我的布局应该是这样的: 有一些问题需要解决: constraintLayout(下周,购物文本)应该位于工具栏底部。 标题文本Next week 滚动完成后可以平滑移动到工具栏中心 水平进度条在con
我似乎无法在我的代码中找到错误。 CollapsingToolbarLayout 没有显示标题,即使我设置了一个。它显示后退按钮但不显示标题,它仍然是普通工具栏的高度。 在工具栏上设置标题或 getS
在我的 MainActivity 中,我有一个 CollapsingToolbarLayout。默认情况下,工具栏是展开的。但我希望它被折叠。因此,正如 StackOverflow 问题中所建议的那样
我有一个触发 CollapsingToolbarLayout 的 RecyclerView,当我尝试在 4.2.2 上重新打开折叠的工具栏时,出现以下崩溃。有什么想法吗? java.lang.Ille
如果有人能给我一些建议来解决我的最新问题,我将不胜感激。 我有一个带有 CollapsingToolbarLayout 的 Activity 。在未折叠状态下,我无法让按钮工作。我不知道如何解决这个问
我将支持设计库的修订版更新到 23.0.1 并得到了这样的行为 - 当侧抽屉重叠时标题消失(抽屉是带有自定义子项的简单 LinearLayout)。没有问题,当我使用 rev. 22.2.1。您对隐藏
在我的应用程序中,我实现了一个包含 Facebook 图片和文本的 CollapsingToolbarLayout,如下图所示: 当图片包含太多白色时,我遇到了一个问题,工具栏 图标保持不可见。 我想
我将 CoordinatorLayout 与 AppBarLayout 和 CollapsingToolbarLayout 一起使用。内容还有一个 NestedScrollView。当我在 Colla
我在带有 RelativeLayout 的 AppBarLayout 中有 CollapsingToolbarLayout
我正在尝试使用我在 CollapsingToolbarLayout 中编写的自定义 View ,但触摸事件似乎无法通过手势检测正确传播到我的自定义 View 。结果是滚动和与 View 的交互无法按预
我是一名优秀的程序员,十分优秀!