android - SlidingUpPanelLayout 可见性问题
问题描述
SlidingUpPanelLayout 有问题。我的观点是这样构建的:
<com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:sothree="http://schemas.android.com/apk/res-auto"
android:id="@+id/list_sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="top"
sothree:umanoDragView="@+id/dragView"
sothree:umanoOverlay="true"
sothree:umanoPanelHeight="@dimen/filtering_list_closed_height"
sothree:umanoShadowHeight="@dimen/app_bar_elevation">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
// some views
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<FrameLayout
android:id="@+id/list_filtering_fragment_container"
android:name="com.example.test.scenes.list.filtering.FilteringFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
它一直在工作,直到我添加了必须将list_filtering_fragment_container
可见性设置为的新功能GONE
。当我切换可见性状态时一切正常,但当我移动到另一个片段并返回到前一个片段时它不起作用。
编辑
看起来像:
设置可见性后我想要达到的正常状态VISIBLE
设置可见性后的状态VISIBLE
(更改片段后)
我还可以在布局检查器中看到,两种情况下,屏幕上的位置和该元素的高度都不同。我尝试使用slidingUpPanel.setPanelState(PanelState.HIDDEN)
,但由于某种原因它在 100% 的情况下不起作用。看起来视图超出了屏幕并且没有回到正确的位置。问题是为什么它会这样?
解决方案
推荐阅读
- android - 添加或删除 ViewTreeObserver 侦听器的正确位置是什么?
- postgresql - 大型文档的全文搜索
- jenkins - 从 Jenkins Amazon ECS 插件 1.16 升级到 1.20 导致需要处理 iam:passRole 和信任关系?
- python - Doxygen:如何在 python 中使用变量名而不是变量类型?
- php - php根据匹配的列名合并数组
- sql - 根据每行的顺序添加行号
- javascript - javascript 在 express.js 控制器中获取一个变量到 mongoose 模式的模型预保存钩子中
- android - root 应用如何访问其他应用的 ui?
- android - 在Android中的进程之间发送消息的可靠方式是什么?
- react-native - 从 CameraRoll.getPhotos() 获取文件名 [React Native IOS]