我想用Flutter创建一个类似的视图,因为我们可以通过UICollectionViewLayout
在 iOS 中创建 a 来实现。
这是我正在使用的示例代码。 https://github.com/flutter/flutter/blob/master/examples/flutter_gallery/lib/demo/material/grid_list_demo.dart
如何GridView
在Flutter 中使用实现这一点。如果没有GridView
,有没有其他方法可以做到?
我正在尝试画一个酒吧。我已经设置了笔触颜色和填充颜色。虽然我用填充颜色设置路径,但它没有被填充。这段代码绘制了一个矩形。
blocks = yValue / yInterval; //Total number of blocks
divider = (self.bounds.size.height * 0.75 - 100)/ blocks ;//height for each block
float factor = value / yValue;
//NSLog(@"%f",factor);
int size = 40;
[[UIColor redColor] setFill];
[[UIColor redColor] setStroke];
UIBezierPath *path = [[UIBezierPath alloc]init];
CGPoint x1 = CGPointMake(0 + 100 + (index * size), self.bounds.size.height * 0.75);
CGPoint x2 = CGPointMake(x1.x + size,self.bounds.size.height * 0.75 );
// float height = (self.bounds.size.height * 0.75) - ((self.bounds.size.height * 0.75) * factor) + …
Run Code Online (Sandbox Code Playgroud)