Auto Layout in RubyMotion.
The concept:
view1.create_constraint do
top >= (superview.top).offset(padding)
left == (superview.left).offset(padding)
bottom == (view3.top).offset(-padding)
right == (view2.left).offset(-padding)
width == view2.width
height == [view2, view3]
end
view2.create_constraint do
top >= (superview.top).offset(padding)
left == (view1.right).offset(padding)
bottom == (view3.top).offset(-padding)
right == (superview.right).offset(-padding)
width == view1.width
height == [view1, view3]
end
view3.create_constraint do
top >= (view1.bottom).offset(padding)
left == (superview.left).offset(padding)
bottom == (superview.bottom).offset(-padding)
right == (superview.right).offset(-padding)
height == [view1, view2]
end
Partially working, see examples in app/
The idea is definitely steal from Masonry, replace the objective-c and function hacking with ruby superpower.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request