无法在底部纸上绘制布局
我创建了一个自定义的进度栏,并将其添加到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()
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它的行为如预期的那样,因为进度栏已连接到活动的窗口,而不是底部的窗口。
底部表的行为就像对话(实际上有一些版本的对话框,例如
bottomSheetDialog
bottomSheetDialogFragment
。像对话框一样,如果我们在底部的底部外面点击,它将被丢弃。还可以向上滑动并滑动以分别激活并停用底部表。如果您想要在
BottomSheet
顶部的Progress bar覆盖层,您需要将其连接到BottomSheet
对话框窗口而不是活动的窗口。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 theBottomSheet
dialog window instead of the activity's window.