当前位置: 动力学知识库 > 问答 > 编程问答 >

ios - How to stop my UILabel from wrapping unexpectedly?

问题描述:

I have a UILabel set in storyboard with Lines=0 and stretched big enough for 2 or 3 lines.

But when I run, and I set UILabel to a sentence of text, it injects a line feed after each of the first few words.

I set .text = "GPS 37.664051,-121.910774"

but it then displays as:

GPS

37.6640

43,-121.9

10789

My UILabel is stretched across the screen horizontally, and stretched vertically to obviously allow up to 4 lines.

Init:

self.loggedInLabel.text = @"RUNNING";

self.loggedInLabel.lineBreakMode = NSLineBreakByWordWrapping;

[self.loggedInLabel sizeToFit];

分享给朋友:
您可能感兴趣的文章:
随机阅读: