NSMutableAttributedString * attributedString1 = [[NSMutableAttributedString alloc] initWithString:testString]; 
NSMutableParagraphStyle * paragraphStyle1 = [[NSMutableParagraphStyle alloc] init]; 
[paragraphStyle1 setLineSpacing:15]; 
[attributedString1 addAttribute:NSParagraphStyleAttributeName value:paragraphStyle1 range:NSMakeRange(0, [testString length])]; 
[cLabel setAttributedText:attributedString1]; 
[cLabel sizeToFit];

label 行距的更多相关文章

  1. 可以改变文本行距(行间距)的Label

    ////////////////////////////////////////////////////// /// ///功能:可以改变文本行距(行间距)的Label ///作者:emanlee / ...

  2. C# winform自定义Label控件使其能设置行距

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.D ...

  3. label_设置行距、字距及计算含有行间距的label高度

    // //  ViewController.m //  CNBlogs // //  Created by PXJ on 16/5/27. //  Copyright © 2016年 PXJ. All ...

  4. ios label 自动计算行高详解

    在OC当中自动计算行高主要调用系统的 p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #ffffff } span ...

  5. iOS 学习 - 5.UILabel设置行距

    NSMutableAttributedString *arrString =[[NSMutableAttributedString alloc]initWithString:@"asdass ...

  6. FCKeditor 添加行距、字体功能 (转载)

    一.首先为FCKeditor添加外部插件在fckeditor/editor/plugins文件夹下建立新文件夹lineHeight,并在其中创建fckplugin.js文件,在其文件中办輸入代码:FC ...

  7. Android studio使用gradle动态构建APP(不同的包,不同的icon、label)

    最近有个需求,需要做两个功能相似的APP,大部分代码是一样的,只是界面不一样,以前要维护两套代码,比较麻烦,最近在网上找资料,发现可以用gradle使用同一套代码构建两个APP.下面介绍使用方法: 首 ...

  8. WPF自定义控件与样式(3)-TextBox & RichTextBox & PasswordBox样式、水印、Label标签、功能扩展

    一.前言.预览 申明:WPF自定义控件与样式是一个系列文章,前后是有些关联的,但大多是按照由简到繁的顺序逐步发布的等,若有不明白的地方可以参考本系列前面的文章,文末附有部分文章链接. 本文主要是对文本 ...

  9. 初识IOS,Label控件的应用。

    初识IOS,Label控件的应用. // // ViewController.m // Gua.test // // Created by 郭美男 on 16/5/31. // Copyright © ...

随机推荐

  1. Nginx-server_name匹配规则

    server_name可为IP/domain/localhost/null等任何字符串(字符串server_name也可以用来匹配),注意各个 server 块的顺序. 1.如果只有一个server, ...

  2. CentOS 6 下RPM方式安装MySQL5.6

    CentOS 6 下RPM方式安装MySQL5.6 1. 下载Linux对应的RPM包,如:CentOS6.7_64对应的RPM包,如下:[root@mysql ~]# ll总用量 113808-rw ...

  3. 受限玻尔兹曼机RBM

    相关算法 python代码参考http://blog.csdn.net/zc02051126/article/details/9668439#(作少量修改与注释) #coding:utf8 impor ...

  4. Tkinter

    单个选项 from Tkinter import * root = Tk() v = IntVar() Radiobutton(root, text="One", variable ...

  5. JS兼容IE浏览器的方法

    背景 系统需要兼容蛋疼的IE6... 解决方案 *{ 兼容IE6-8 }* <!--[if lt IE 9]> <script src="@{'/public/mng/ja ...

  6. mysql join的方式结果集

    一张图说明  left join, right join, inner join, full outer join

  7. JSP页面中<%! %>和<% %>的区别

    JSP声明语句:<%!声明语句%>,通常声明全局变量.常量.方法.类JSP Scriptlet:<%java代码%>,其中可包含局部变量.java语句JSP表达式:<%= ...

  8. CentOS6.6 安装 Tengine 笔记

    Tengine官网上有个非常简单的教程,中间并未涉及到一些常用的设置,所以仅供参考.一下午为本人的安装步骤及过程. 1.安装必要的编译环境好 由于Tengine安装需要使用源代码自行编译,所以在安装前 ...

  9. 打印Java main方法执行的命令参数代码

    RuntimeMXBean bean = ManagementFactory.getRuntimeMXBean(); List<String> jvmArgs = bean.getInpu ...

  10. [Hibernate] - many to one

    Hibernate的多对一操作: 例子参考引用: http://www.tutorialspoint.com/hibernate/hibernate_many_to_one_mapping.htm h ...