码迷,mamicode.com
首页 > 其他好文 > 详细

textfield首行缩进

时间:2016-08-09 20:28:09      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:

#pragma mark - UITextView delegate Methods
-(void)textViewDidChange:(UITextView *)textView{
    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
          paragraphStyle.lineSpacing = 30;    //行间距
          paragraphStyle.maximumLineHeight = 60;   /**最大行高*/
          paragraphStyle.firstLineHeadIndent = 20.f;    /**首行缩进宽度*/
          paragraphStyle.alignment = NSTextAlignmentJustified;
    NSDictionary *attributes = @{
                                 NSFontAttributeName:[UIFont systemFontOfSize:15],
                                 NSParagraphStyleAttributeName:paragraphStyle
                                 };
    textView.attributedText = [[NSAttributedString alloc] initWithString:textView.text attributes:attributes];
}

textfield首行缩进

标签:

原文地址:http://www.cnblogs.com/YH-Coding/p/5754290.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!