瀏覽代碼

Example: achieve proportional height division

MarcinZiabek 3 年之前
父節點
當前提交
16a164e5b8
共有 1 個文件被更改,包括 36 次插入0 次删除
  1. 36 0
      QuestPDF.Examples/RowExamples.cs

+ 36 - 0
QuestPDF.Examples/RowExamples.cs

@@ -105,5 +105,41 @@ namespace QuestPDF.Examples
                         .Row(row => { });
                         .Row(row => { });
                 });
                 });
         }
         }
+        
+        [Test]
+        public void RowElementForRelativeHeightDivision()
+        {
+            RenderingTest
+                .Create()
+                .ProduceImages()
+                .ShowResults()
+                .MaxPages(100)
+                .PageSize(250, 400)
+                .Render(container =>
+                {
+                    container
+                        .Padding(25)
+                        .AlignLeft()
+                        .RotateRight()
+                        .Row(row =>
+                        {
+                            row.Spacing(20);
+
+                            row.RelativeItem(1).Element(Content);
+                            row.RelativeItem(2).Element(Content);
+                            row.RelativeItem(3).Element(Content);
+
+                            void Content(IContainer container)
+                            {
+                                container
+                                    .RotateLeft()
+                                    .Border(1)
+                                    .Background(Placeholders.BackgroundColor())
+                                    .Padding(5)
+                                    .Text(Placeholders.Label());
+                            }
+                        });
+                });
+        }
     }
     }
 }
 }