如何滚动JetPack组合屏幕溢出其内容?
我有一个添加的购物清单项目JetPack组成的屏幕,其中包含几个Textfield
输入和一个位于底部的图像容器。屏幕在底部溢出并切断。如何滚动屏幕?
I have an Add Shopping List item Jetpack Compose screen which contains several TextField
inputs and an image container at the bottom. The screen overflows at the bottom and is cut off. How can I scroll the screen?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
编辑:2023年10月
在此过程中的某个时候,旧解决方案不再起作用。现在解决这个问题的解决方案是:
旧解决方案
添加
修改器。可滚动(..)
到您希望制作可滚动的容器。代码将是这样的:
当然,还有其他
修饰符
用于使组合滚动的方法可能更适合您的情况。EDIT: October 2023
At some point along the way this was changed and the old solution does not work anymore. The solution to this question is now:
Old solution
Add
Modifier.scrollable(..)
to the container that you wish to make scrollable.Code would be something like this:
Of course, there are other
Modifier
methods for making composables scrollable that might fit better for your case.如果批准的答案不起作用,请尝试下面的尝试,
请不要忘记将其应用于您的父母合并
If the approved answer is not working try like below
Do not forget to apply it to your parent composable
您可以在容器上使用修饰符
垂直旋转
实现此目的。You can use the modifier
verticalScroll
on your container to achieve this.