android - AppBarLayout setExpanded速度慢

标签 android android-collapsingtoolbarlayout android-appbarlayout android-support-design

我在 AppBarLayout 中使用了 CollapsingToolbarLayout,用户可以使用 AppBarLayout 中的 setExpanded(boolean) 方法展开或折叠它。

问题是动画很慢而且不流畅。

我一直在搜索,似乎支持设计库有问题(请阅读 question )。但是我无法降级我的支持设计库,因为我正在使用 BottomSheetBehavior 并且我收到以下错误:

Error:(88) No resource identifier found for attribute 'behavior_hideable' in package...
Error:(88) No resource identifier found for attribute 'behavior_peekHeight' in package...

有什么提高 setExpand 速度的建议吗?

最佳答案

使用 appBarLayout.setExpanded(true,true); 而不是 setExpanded(boolean) 并且展开将是动画的

关于android - AppBarLayout setExpanded速度慢,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37889577/

相关文章:

Android HLS- Streaming 无法获取 fragment

java - Android模拟器不显示存储的图像

android - 如何在 recyclerView 向下滚动时折叠后隐藏工具栏

android - CoordinatorLayout/AppBarLayout ExpandableListView 在屏幕外呈现

android-studio - 防止折叠工具栏针对某些片段展开

android - 如何修复 Coordinator Layout 中的布局?

java - 致命异常 : AsyncTask #2 An error occured while executing doInBackground() IndexOutOfBoundsException: Invalid index 1, 大小为 1

android - 为什么我们不能在 jetpack compose 的 mutableStateListOf 中使用 delegate 属性

android - 如何在scrollview上方使用CollapsingToolbarLayout?