如何提高底部表格的高度遵循垂直翻译
我正在尝试在bottosheetDialog
中垂直移动视图,但是我会得到意外的行为。
My BottomSheet
looks like this
Before Translation

I'm moving my constraint Layout with myLayout.animate().translationY(-100f).setStartDelay(0).start()
That's the BottomSheet
after the translation:
After Transition

如何动态地遵循BottomSheet
的大小以遵循翻译?
I'm trying to move views vertically in a BottoSheetDialog
, but I'm getting an unexpected behavior.
My BottomSheet
looks like this
Before Translation
I'm moving my constraint Layout withmyLayout.animate().translationY(-100f).setStartDelay(0).start()
That's the BottomSheet
after the translation:
After Transition
How can I increase the size of the BottomSheet
dynamically to follow the translation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我所知,您可以以编程方式更改
BottomSheet
的高度,在我的应用程序中,我正在使用以下代码来制作bottomSheet
对话框。如果可能的话,屏幕:因此,在您的情况下:
更改
(int)(screenutils.getScreenheight())
带有您的尺寸值。As far as I know, you can change the height of the
BottomSheet
programmatically, in my application, I'm using the following code to make theBottomSheet
dialog take the height of the screen if possible:So in your case :
Change
(int) (ScreenUtils.getScreenHeight())
with your size value.我找到了解决这个问题的替代解决方案。我只是在布局底部添加了一个空视图,其高度为1DP。我正在增加这样的大小
I found an alternative solution to solve this problem. I just added a empty view with 1dp height at the Bottom of my layout. I'm increasing it's size like this