小编Aru*_*nan的帖子

如何在 Flutter 中使用 GridView 创建不同大小的单元格?

我想用Flutter创建一个类似的视图,因为我们可以通过UICollectionViewLayout在 iOS 中创建 a 来实现。

这是我正在使用的示例代码。 https://github.com/flutter/flutter/blob/master/examples/flutter_gallery/lib/demo/material/grid_list_demo.dart

如何GridViewFlutter 中使用实现这一点。如果没有GridView,有没有其他方法可以做到?

动态尺寸

flutter flutter-layout

6
推荐指数
2
解决办法
5767
查看次数

路径未填充颜色

我正在尝试画一个酒吧。我已经设置了笔触颜色和填充颜色。虽然我用填充颜色设置路径,但它没有被填充。这段代码绘制了一个矩形。

 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)

ios uibezierpath

0
推荐指数
1
解决办法
804
查看次数

标签 统计

flutter ×1

flutter-layout ×1

ios ×1

uibezierpath ×1