1
有誰知道如何在iOS 5,XCode 4.3中的文本框中插入項目符號並進行一些格式設置,也許在webview中(如下面的打印屏幕所示)?iOS5中的文本框中的格式和項目符號
有誰知道如何在iOS 5,XCode 4.3中的文本框中插入項目符號並進行一些格式設置,也許在webview中(如下面的打印屏幕所示)?iOS5中的文本框中的格式和項目符號
對於UITextView
手動添加點和換行,例如:
NSArray *items = [NSArray arrayWithObjects:@"Stack",@"Overflow",nil];
NSMutableString *formattedString = [[NSMutableString alloc] init ];
for (NSString *item in items) [formattedString appendFormat:@"\u2022 %@\n", item];
theTextViewName.text = formattedString;
對於UIWebView
創建一個無序HTML
列表,例如:
NSArray *items = [NSArray arrayWithObjects:@"Stack",@"Overflow",nil];
NSMutableString *theSource = [[NSMutableString alloc] init ];
[theSource appendFormat:@"<ul>"];
for (NSString *item in items) [theSource appendFormat:@"<li>%@</li>", item];
[theSource appendFormat:@"</ul>"];
[theWebView loadHTMLString:theSource baseURL:nil];
兩個結果進以下列表:
- 堆棧
- 溢出