【发布时间】:2019-10-19 05:46:00
【问题描述】:
我正在设置一个可以点击以更改颜色的网格(如 litebrite)。但是,它不是创建整个网格,而是创建一个框。
这是当前输出的图像:https://imgur.com/a/e8d1CPw
for (int row = 0; row < rows; row++)
{
for(int col = 0; col < cols; col++)
{
BoxView box = new BoxView
{
VerticalOptions = LayoutOptions.Start,
HorizontalOptions = LayoutOptions.Start,
Color = borderColor,
};
/* add code create TapGestureRecognizer entry */
var tap = new TapGestureRecognizer();
box.GestureRecognizers.Add(tap);
tap.Tapped += OnBoxViewTapped;
// Add the current box to the boxes list
boxes.Add(box);
// Add the current box to the mainGrid
mainGrid.Children.Add(box);
}
}
【问题讨论】:
-
请不要发布代码或输出的图片。为了获得最佳响应和反馈,请将您的输出复制/粘贴到您的问题帖子中。