无法在底部纸上绘制布局

发布于 2025-01-21 06:11:00 字数 424 浏览 0 评论 0原文

我创建了一个自定义的进度栏,并将其添加到Window Decorview的根视图中。但是,当可见底部纸时,该进度条是在底部纸的后面绘制的,而不是在其顶部绘制。不应该在底部纸上画吗?

val loader = FullScreenLoader(
requireContext(),
containerView = requireActivity().window.decorView.rootView as ViewGroup
)

loader.show()

I have created a custom progress bar and I have added it to the window decorview's root view. However, when a bottom sheet is visible, this progress bar is drawn behind the bottom sheet rather than drawing on top of it. Shouldn't it be drawn on top of the bottom sheet?

val loader = FullScreenLoader(
requireContext(),
containerView = requireActivity().window.decorView.rootView as ViewGroup
)

loader.show()

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

叶落知秋 2025-01-28 06:11:00

不应该在底部的纸上绘制吗?

它的行为如预期的那样,因为进度栏已连接到活动的窗口,而不是底部的窗口。

底部表的行为就像对话(实际上有一些版本的对话框,例如 bottomSheetDialog bottomSheetDialogFragment 。像对话框一样,如果我们在底部的底部外面点击,它将被丢弃。还可以向上滑动并滑动以分别激活并停用底部表。

如果您想要在BottomSheet顶部的Progress bar覆盖层,您需要将其连接到BottomSheet对话框窗口而不是活动的窗口。

Shouldn't it be drawn on top of the bottom sheet?

It behaves as expected as the progress bar is attached to the activity's window, not to the bottom sheet window.

Bottom sheets behave like dialogs (actually there are versions of them that extend Dialogs like BottomSheetDialog & BottomSheetDialogFragment. Like dialogs, if we tap outside the Bottom Sheet, it is dismissed just. there are also slide up and slide down to activate and deactivate the Bottom Sheet respectively.

If you want that progress bar overlay on top of the BottomSheet, you need to attach it to the BottomSheet dialog window instead of the activity's window.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文