gpt4 book ai didi

java - GridView 我必须显示 3X3 矩阵如何做到这一点

转载 作者:行者123 更新时间:2023-11-30 11:31:58 24 4
gpt4 key购买 nike

GridView 我必须显示 3X3 矩阵如何做到这一点。

输入值是水平值和垂直值。

例如水平值为 3 垂直值为 3 那么我必须显示为以下格式

1 2 3
4 5 6
7 8 9

例如水平值为 2 垂直值为 2 那么我必须显示为以下格式

1 2
3 4

例如水平值为 3 垂直值为 2 那么我必须显示为以下格式

1 2 3
4 5 6

最佳答案

根据你的情况使用如下:

         setNumColumns(int)

这将在运行时设置列数。

   for example horizontal value is 3 and vertical value 3 then i have to diaplay to below format

setNumColumns(3)

for example horizontal value is 2 and vertical value 2 then i have to diaplay to below format

setNumColumns(2)

for example horizontal value is 3 and vertical value 2 then i have to diaplay to below format

setNumColumns(2)

关于java - GridView 我必须显示 3X3 矩阵如何做到这一点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16911118/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com