IOS中的正交连字词 [英] Orthographic hyphenation word in IOS

查看:107
本文介绍了IOS中的正交连字词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有正字连字词的方法?

Is there a way of orthographic hyphenation word?

这样的事情:

NSStiring *string = @"In June 2010 at the World Wide Developers Conference, Apple announced version 4 of Xcode during the Developer Tools State of the Union address.";
UILabel *label = [[UILabel alloc] init];
label.text = string;

如果框架UILabel将缩小,请获取下一个:

And if frame UILabel will be narrow, get next:


2010年6月在

全球范围内

开发商Con-

ference,Apple

宣布ver-

sion 4 of Xcode

在开发期间 -

oper工具状态

of the Union ad-

dress。

In June 2010 at
the World Wide
Developers Con-
ference, Apple
announced ver-
sion 4 of Xcode
during the Devel-
oper Tools State
of the Union ad-
dress.


推荐答案

将NSAttributedString与NSParagraphStyle一起使用 hyphenationFactor 为1。

Use an NSAttributedString with an NSParagraphStyle with a hyphenationFactor of 1.

这篇关于IOS中的正交连字词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆