Objective c 如何在UILabel的不同行中显示两个NSAttribute字符串

Objective c 如何在UILabel的不同行中显示两个NSAttribute字符串,objective-c,uilabel,nsattributedstring,Objective C,Uilabel,Nsattributedstring,我需要在UILabel中显示属性字符串的两行,例如,第一行显示TopMessage,第二行显示BottomMessage。它们都是NSAttribute字符串 我使用了下面的代码,但是我没有得到我想要的。顶部消息和底部消息位于同一行。有人能帮我吗?非常感谢 _eventInfoLbl.lineBreakMode = NSLineBreakByWordWrapping; _eventInfoLbl.numberOfLines = 0; _eventInfoLbl.attributedText =

我需要在UILabel中显示属性字符串的两行,例如,第一行显示TopMessage,第二行显示BottomMessage。它们都是NSAttribute字符串

我使用了下面的代码,但是我没有得到我想要的。顶部消息和底部消息位于同一行。有人能帮我吗?非常感谢

_eventInfoLbl.lineBreakMode = NSLineBreakByWordWrapping;
_eventInfoLbl.numberOfLines = 0;
_eventInfoLbl.attributedText = info(nsattributed string which holds theTopMessage and theBottomMessage);
[_eventInfoLbl sizeToFit];

在两部分之间的字符串中换行。@rmaddy刚刚试过。它起作用了。非常感谢: