动态添加子项到 GridLayout

发布于 2024-12-25 17:15:57 字数 131 浏览 5 评论 0原文

我有一个应用程序,它将根据用户选择的尺寸显示同一图像的网格。我正在使用 GridLayout 来构建该网格,但到目前为止,我一直无法找到一种在 java 代码中设置子项(该图像的倍数)的方法,以便网格的大小和子项的数量将随设置而改变。有什么建议吗?

I have an app that will display a grid of the same image, based on the dimensions chosen by the user. I'm using GridLayout to build that grid, but so far, I have been unable to figure out a way to set up the children (multiples of that image) in the java code so that the size of the grid and number of children will change with the settings. Any suggestions?

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

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

发布评论

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

评论(1

阪姬 2025-01-01 17:15:57

我找到了一些应该对我有用的东西。在宣布 GridLayout 的博客文章中,他们发布了 这段代码很容易地展示了如何添加到网格中。

I found something that should work for me. In the blog post announcing GridLayout, they posted this code that pretty easily shows how to add to the Grid.

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