quattro_4 scribble

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

NSScreencast Episode #133 Auto Layout in Code

Auto Layout in Code - NSScreencast

コードでAutoLayoutを指定

  • reason to use code
    • in storyboard, accidentally break with drag and drop
  • NSLayoutConstraint constraintWithItem
    • attribute (引数, 2回?)
    • relatedBy
    • attribute
  • [headlineView addConstraint:headlineHeight];
  • attribute
    • NSLayoutAttributeNotAnAttribute
    • NSLayoutAttributeTop/Bottom
    • NSLayoutAttributeLeading/Trailing
    • NSLayoutAttributeHeight/Width
  • toItem:self.view
    • 対象なし toItem:nil
  • leftView.translatesAutoresizingMaskIntoConstraints = NO;
  • 左3割の幅
    • constraintWithItem:leftView, toItem:headlineView
    • NSLayoutAttributeWidth
    • multiplier:0.3
  • button to centering
    • hard to do by itself
    • add parent view to button

Good to know
めんどうそう