zoukankan      html  css  js  c++  java
  • iOS 关于UIlabe 行间距设置

      ///设置每行间距

        NSMutableDictionary *textDict = [NSMutableDictionary dictionary];

        textDict[NSKernAttributeName] = @(1);

        label.attributedText = [[NSAttributedString alloc] initWithString:label.text attributes:textDict];

        NSMutableAttributedString *text1 = [[NSMutableAttributedString alloc] initWithString:label.text];

        //设置缩进、行距

        NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];

        style.alignment = NSTextAlignmentLeft;

        style.lineSpacing = 5;

        [text1 addAttribute:NSParagraphStyleAttributeName value:style range:NSMakeRange(0, text1.length)];

        label.attributedText = text1;

            lable.frame = CGRectMake(0, 0, contexWidth,titleSize.height + (titleSize.height/singetHeight ) * 5);

  • 相关阅读:
    Redis主从复制
    Redis发布订阅
    Redis持久化
    初探redis.config
    java连接Linux服务器问题
    Redis常见类型及API
    Redis安装
    Nosql
    JMM
    SpringSecurity
  • 原文地址:https://www.cnblogs.com/GUANGANJIUQI/p/13727401.html
Copyright © 2011-2022 走看看