ios - 多行中行与行之间的核心文本空间

标签 ios uitextview multiline uifont core-text

UITextView和Core Text绘制

为什么多行之间的间距不同?

enter image description here

最佳答案

简单

CGFloat lineHeight = 17.0;

CTParagraphStyleSetting settings[2] = {
        { kCTParagraphStyleSpecifierMinimumLineHeight, sizeof(lineHeight), &lineHeight },
        { kCTParagraphStyleSpecifierMaximumLineHeight, sizeof(lineHeight), &lineHeight }
}

关于ios - 多行中行与行之间的核心文本空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7955197/

相关文章:

css - 我如何垂直居中对齐 div 与动态多行文本

c++ - Windows 黄色工具提示多行?

iphone - 为什么我不能访问此UITextView实例的.layer.borderWidth? (附加代码)

ios - UIGestureRecognizer 崩溃

ios - 确定 CATextLayer 中文本框的大小

ios - 从 Xcode 11.1 升级到 Xcode 11.2 后,应用程序因 _UITextLayoutView 崩溃

Ruby - 语句中不正确的换行符仍然会给出结果吗?

ios - 在不使用 Xamarin 中的默认/内置应用程序的情况下在 iOS 和 Android 中发送电子邮件

iOS 8 boundingRectWithSize 计算错误的文本大小

objective-c - UITextView,行号未对齐