UITextView 中的项目符号列表和编号列表

问题描述 投票:0回答:2

任何人都可以告诉我如何将项目符号列表和编号列表添加到 UITextView 中的选定文本吗?

objective-c cocoa-touch ipad uitextview
2个回答
30
投票

检查这个问题:iphone 要点列表

您可能想将项目符号的 unicode 字符添加到您的行中 (@"\u2022)

NSArray * items = ...;
NSMutableString * bulletList = [NSMutableString stringWithCapacity:items.count*30];
for (NSString * s in items)
{
   [bulletList appendFormat:@"\u2022 %@\n", s];
}
textView.text = bulletList;

0
投票

这是一个开源项目,您可以尝试一下AYTextView

© www.soinside.com 2019 - 2024. All rights reserved.