MotionInMotion Episode 23 - MotionKit Basics and AutoLayout
MotionKit Basics and AutoLayout - MotionInMotion
motion-kitでレイアウト
- gem install 'motion-kit'
- new gem for styling
- good-bye teacup
- class ExampleLayout < MotionKit::Layout
- add UIView, :header do
- background_color UIColor.darkGrayColor
- add UILabel, :main_text do
- text_alignment UITextAlignmentCenter
- text_color UIColor.whiteColor
- target.numberOfLines = 0
- def add_constraints
- constraints(:main) do
- top.equals(:header, NSLayoutAttributeBottom).plus(20)
- width.equals(:header).divided_by(2).minus(10)
- constraints(:main) do
- add UIView, :header do
- dependency
- DBT (Dependencies and deBugging Tool) colinta/dbt · GitHub