UILabelを上寄せにしたい場合がある。 その場合、OHAttributedLabelやTTTAttributedLabelなど便利なライブラリがあるけど、ただ単に上寄せしたいだけならばUILabelの高さを適切なサイズに変更してあげれば上寄せになる。(上寄せというか高さを文字が入るぎりぎりに調整するだけだが) やり方 - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; //Labelの設定 self.topAlignmentLabel.backgroundColor = [UIColor yellowColor]; self.topAlignmentLabel.numberOfLines = 0; self.topAlignmentLabel.text = @"abcdefghijklmnop
