UILabel和TextView手动换行

UILabel 的换行符是 '\n';

例如:

1 _explainsNotificationLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, 40)];
2     _explainsNotificationLabel.text = @"回想单词的意思\n根据回忆结果选择‘记得’或‘忘了’";
3     _explainsNotificationLabel.numberOfLines = 0; // 关键的一句

UITextView的换行符是'\r\n',使用方法同上

posted on 2015-05-03 12:23  码农之上~  阅读(623)  评论(0编辑  收藏  举报

导航