Skip to content

siuying/moria

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Moria

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

Status

Partially working, see examples in app/

About

The idea is definitely steal from Masonry, replace the objective-c and function hacking with ruby superpower.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

Auto Layout in RubyMotion.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages