iPhone/Objective - C - 如何在 UILabel 中显示长字符串的整个文本

标签 iphone objective-c xcode nsstring uilabel

我有一个很长的字符串,如下所示......

[[sqrt(221)-10,-sqrt(221)-10],[11,11]],[[rootof([[474368400,237184200,-125944810200,258530778000],[1,0,-472,884,42215]])/(sqrt(221)*782707860000)+rootof([[409681800,9099248400,-99876110400,-1875803589000],[1,0,-472,884,42215]])/(sqrt(221)*782707860000)*3,rootof([[-3439170900,-50638826700,864180632700,9670592794500],[1,0,-472,884,42215]])/(sqrt(221)*782707860000)+rootof([[1477010700,22974524100,-369910322100,-4442729593500],[1,0,-472,884,42215]])/(sqrt(221)*782707860000)*3],[rootof([[474368400,237184200,-125944810200,258530778000],[1,0,-472,884,42215]])/(sqrt(221)*782707860000)*2+rootof([[409681800,9099248400,-99876110400,-1875803589000],[1,0,-472,884,42215]])/(sqrt(221)*782707860000)*4,rootof([[-3439170900,-50638826700,864180632700,9670592794500],[1,0,-472,884,42215]])/(sqrt(221)*782707860000)*2+rootof([[1477010700,22974524100,-369910322100,-4442729593500],[1,0,-472,884,42215]])/(sqrt(221)*782707860000)*4]],[sqrt(sqrt(221)+15),sqrt(-sqrt(221)+15)]

如何在 UILabel 中显示超过一行 (0) 的全部内容?

此外,虽然字符串中没有换行符(“\n”),但结果显示如下......

[[sqrt(221)-10,-sqrt(221)-
10],[11,11]],[[rootof([[474368400,2
37184200,-
125944810200,258530778000],[1,
0,-
472,884,42215]])/(sqrt(221)*78270

有什么帮助吗?

PS 我可以上传图片,但我不被允许,因为我是新用户......

最佳答案

 textLabel.lineBreakMode = UILineBreakModeWordWrap;
 textLabel.numberOfLines = 0;

关于iPhone/Objective - C - 如何在 UILabel 中显示长字符串的整个文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11225460/

相关文章:

iphone - 创建用于保存数据的唯一字符串

iPhone OpenGL : Using gluUnProject (port) and detecting clicking on an object

ios - 我在哪里可以获得 SpringBoardServices 源代码

objective-c - 如何修改我的 Cocoa 应用程序中自动生成的关于窗口?

iphone - 为什么不需要在 NSURLConnectionDelegate 协议(protocol)中声明 NSURLConnection 委托(delegate)方法

ios - 查看调解中心通信历史记录的任何选项 - iTunes Connect

iphone - UIAlertView 的 TextField 的自动大写

ios - 使用 Stripe 和 Parse 存储信用卡。没有方法每个错误

c++ - 使用 Xcode 7.3.1 编译时出现“unordered_map”文件未找到错误

ios - iTunes 连接,Xcode 在管理器中验证