首页 > 其他 > 详细

textfield首行缩进

时间:2016-08-09 20:26:12      阅读:257      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!