1
我需要將換行符添加到從plist獲取的字符串中。該字符串被傳遞到屏幕上顯示的UILabel
。
例如,我的文本就像"Adding a line break to a string from plist in iOS"
我需要在單詞分隔符後換行。從iOS中的plist向字符串添加換行符
我已經添加了"\n"
,因此文本變成了「從iOS中的plist添加換行符到字符串」。確保numberoflines = 0
爲UILabel
。
但我看不到換行符和文本"\n"
出現在文本本身。
需要一些指導這個..謝謝..
編輯:
[photo setCaption:[NSString stringWithFormat:@"%@",[[galleryArray objectAtIndex:index] objectForKey:@"Title"]]];
你能告訴你如何從plist中獲得你的字符串嗎? – mdziadkowiec
我想要的是編碼。 – satheeshwaran
你想在plist文件中的字符串中換行嗎?只需在plist編輯器中編輯字符串時輸入「option-Return」即可。這會在價值中添加一條換行符。 – rmaddy