collapse mode 严重_Android工具栏collapseMode问题
我有一个问题是“带有标题文本的工具栏”在CollapsingToolbarLayout中向上滚动时不折叠.
我尝试了一些调整,使用app:layout_collapseMode =“none”作为我的android.support.v7.widget.Toolbar中的属性,但它不起作用.也许我的布局有问题.
以下是我想要实现的目标.
但是当我滚动到顶部时,工具栏也会折叠,并且tabBar也会向内滚动,并变得不可见.以下就是我现在所拥有的.
这是我的布局代码
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:contentScrim="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways">
android:layout_width="match_parent"
android:layout_height="250dp"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.7">
android:id="@+id/backdrop"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop" />
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#20000000" />
android:id="@+id/toolbar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="none"
>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Application Title"
android:textColor="#fff"
android:textSize="18sp" />
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways">
android:id="@+id/detail_tabs"
android:layout_width="match_parent"
android:layout_height="60dp"
app:layout_collapseMode="pin"
android:background="#00000000"
app:tabSelectedTextColor="#3498db"
app:tabTextColor="#000" />
/>
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#333"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
依赖
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile "com.android.support:appcompat-v7:22.2.1"
compile "com.android.support:support-annotations:22.2.1"
compile "com.android.support:design:22.2.1"
compile 'com.android.support:recyclerview-v7:22.2.1'
compile 'com.android.support:cardview-v7:22.2.1'
}
collapse mode 严重_Android工具栏collapseMode问题相关推荐
- kotlin xml布局_Android工具栏教程– XML布局和Kotlin
kotlin xml布局 Android Toolbar widget is used to create menus in the apps. We will learn how to create ...
- android浮动按钮_Android浮动操作按钮示例教程
android浮动按钮 Today we will learn about Android Floating Action Button. We'll discuss the FloatingActi ...
- FCKeditor隐藏工具栏
加载后自动隐藏工具条 FCKeditor_OnComplete是在FCKeditor加载完成后自动执行的函数,函数名必须要以FCKeditor_OnComplete命名.可以在该函数中执行一些初始化工 ...
- AndroidStudio 在工具栏上设置显示前进和后台的方法
显示这个工具 如果不显示可能是这样的没有设置工具栏效果如下 这个是因为没有设置工具栏代码在工具栏这一行显示了 设置方法view---> Appearance----->勾选Toolbar ...
- Android Studio 工具栏消失了 设置回来
如果开发工具的工具栏不见了如下 底部的也不见了 这个时候要设置回来很简答的 版本变动补充:目前as 4.0.1版本在 view ---> Appearance 里面 下面的是之前很早的版本. ...
- Eclipse工具栏上android的机器人小图标和adt图片的显示
这个在ecplise的工具栏上 Windows ---Perspective---open Perspective ---other, 里面就有了 手机像素不好,勉强能看清
- unity编辑器扩展_01(在工具栏中创建一个按钮)
代码: [MenuItem("Tools/Test",false,1)] static void Test() { Debug.Log(" ...
- Windows Phone 7编程学习点滴一——页面切换、返回键重载和工具栏
1. 页面切换和对齐方式 2 (1)XAML实现方式 <HyperlinkButton Content="TestPage1" NavigateUri="/Test ...
- 【Qt】菜单栏、工具栏、状态栏、右键菜单的实现
在QMainWidget基础上实现菜单栏.工具栏.状态栏.右键菜单. 头文件: #ifndef GWDEMO_H #define GWDEMO_H#include <QMainWindow> ...
- symfony2项目访问app_dev.php不显示debug工具栏的问题
2019独角兽企业重金招聘Python工程师标准>>> 当在symfony2中比如添加一个bundle后,访问app_dev.php时不会显示底部debug工具栏,一种情况是模板中没 ...
最新文章
- 用进化算法来优化SVM的参数C和Gamma——利用SCOOP库进行分布式加速计算
- oracle sql练习_数据分析之学习SQL
- 以GIS面对崛起的城市群
- CCF之地铁修建(100分)
- 怎样查看电脑开机记录
- search engine php,用php简单实现search engine friendly的url_php技巧
- python项目之古诗文网
- Python学习笔记之几点代码格式要求
- sscanf %*s
- 关于微信支付后回调验证的处理
- python匿名函数表达式_在Python中使用lambda表达式进行赋值
- PhotoShop如何给字体添加下划线
- 十四步实现拥有强大AI的五子棋游戏
- 马蜂窝张矗:绩效考核是为了激发工作潜力,而不是逃避问题
- C语言自学之路三(循环、选择、函数、数组)
- 思考-IT行业设备分销代理商的运营模式
- 运维工程师项目案例_要建设AIOps,运维工程师的角色和职责需如何调整?
- A2M人工智能与机器学习创新峰会参会感悟 by江舟
- [0892]《兽医内科学》主观题
- WPS计算机一级考试知识点,计算机一级考试WPS练习题及答案