动态添加子项到 GridLayout
我有一个应用程序,它将根据用户选择的尺寸显示同一图像的网格。我正在使用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了一些应该对我有用的东西。在宣布 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.