quattro_4 scribble

scribble 落書き (調べた事をただ落書きする)

RubyMotion for Rails Developers: MotionKit (part 1 & 2)

RubyMotion for Rails Developers: MotionKit (part 1) - MotionInMotion

RubyMotion for Rails Developers: MotionKit (part 2) - MotionInMotion

MotionKit (part 1)

  • gem 'motion-kit'
  • class MainLayout < MotionKit::Layout
    • def layout
      • add UILabel, :label
    • def label_style
      • text "Do the dishes"
      • color UIColor.whiteColor
      • font UIFont.systemFontOfSize(24)
      • constraints do
        • top_left.equals(:superview).plus([20, 20])
        • width.equals(:superview).minus(40)

MotionKit (part 2)

  • suffix
    • _style
    • def name_label_style
      • adjusts_font_size_to_fit_width true
      • minimum_scale_factor 0.8
    • def profile_image_style
      • image UIImage.imageNamed("profile_photo.jpg")
    • constraints do
      • top , left , right , bottom
      • width , height
      • .equals
        • .plus , .minus
      • comparison
        • height.is <= 61