calculator: improve iOS variation
[nit.git] / examples / calculator / src / ios.nit
index a7acc6f..c1cc4ae 100644 (file)
@@ -22,11 +22,18 @@ redef class CalculatorWindow
        init do title = "app.nit Calculator"
 end
 
+redef class Button
+       init do size = 2.5
+end
+
 redef class TextInput
-       init do set_ios_style(native)
+       init
+       do
+               size = 5.0
+               align = 0.5
+       end
+end
 
-       private fun set_ios_style(objc_text_field: UITextField)
-       in "ObjC" `{
-               objc_text_field.textAlignment = NSTextAlignmentCenter;
-       `}
+redef class VerticalLayout
+       redef init do native.distribution = new UIStackViewDistribution.fill_proportionally
 end