gpt4 book ai didi

iphone - 增加行之间的空间 UITextView

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:49:27 24 4
gpt4 key购买 nike

我们如何增加 UITextView 中两行之间的间距。我搜索了相关主题,其中他们正在创建自己的字体。我也试过了。它不工作。

- (void)viewDidLoad
{
[super viewDidLoad];
org_txtvw_rect = CGRectMake(self.text_view.frame.origin.x,
self.text_view.frame.origin.y,
self.text_view.frame.size.width,
self.text_view.frame.size.height);

[text_view.text sizeWithFont:[UIFont systemFontOfSize:14]
constrainedToSize:CGSizeMake(100, MAX_HEIGHT)
lineBreakMode:UILineBreakModeWordWrap];
}

我做错了什么吗?

我们可以将此属性用于行间距吗?

text_view.font.lineHeight

最佳答案

您不能直接在 UITextView 中更改行距。尝试使用 Core Text 绘制文本。使用 Core Text 意味着你需要做很多工作,看看 https://github.com/mattt/TTTAttributedLabel

关于iphone - 增加行之间的空间 UITextView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12003393/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com