UITextView中的项目符号列表和编号列表 [英] Bullet list and Numbered list in UITextView

查看:778
本文介绍了UITextView中的项目符号列表和编号列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

解决方案

任何机构都可以告诉我如何在UITextView中为所选文字添加项目符号列表和编号列表。问题: iPhone项目符号列表



您可能希望将unicode字符的bulletpoints添加到您的行(@\\\•)

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


Can any body tell me how to add bullet list and numbered list to the selected text in UITextView.

解决方案

Check this question: iphone bullet point list

You might want to add the unicode char of bulletpoints to your lines (@"\u2022)

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

这篇关于UITextView中的项目符号列表和编号列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆