lib/ios: layouts have different behavior according to the orientation
authorAlexis Laferrière <alexis.laf@xymus.net>
Fri, 15 Apr 2016 19:08:31 +0000 (15:08 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Tue, 17 May 2016 15:28:40 +0000 (11:28 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/ios/ui/ui.nit

index a4a0000..875f739 100644 (file)
@@ -180,7 +180,6 @@ redef class Layout
        init
        do
                native.alignment = new UIStackViewAlignment.fill
-               native.distribution = new UIStackViewDistribution.fill_equally
 
                # TODO make customizable
                native.spacing = 4.0
@@ -197,11 +196,19 @@ redef class Layout
 end
 
 redef class HorizontalLayout
-       redef init do native.axis = new UILayoutConstraintAxis.horizontal
+       redef init
+       do
+               native.axis = new UILayoutConstraintAxis.horizontal
+               native.distribution = new UIStackViewDistribution.fill_equally
+       end
 end
 
 redef class VerticalLayout
-       redef init do native.axis = new UILayoutConstraintAxis.vertical
+       redef init
+       do
+               native.axis = new UILayoutConstraintAxis.vertical
+               native.distribution = new UIStackViewDistribution.equal_spacing
+       end
 end
 
 redef class Label