Can any body tell me how to add bullet list and numbered list to the selected text in UITextView.
In bulleted lists, each paragraph begins with a bullet character. In numbered lists, each paragraph begins with an expression that includes a number or letter and a separator such as a period or parenthesis. The numbers in a numbered list are updated automatically when you add or remove paragraphs in the list.
To start a numbered list, type 1, a period (.), a space, and some text. Word will automatically start a numbered list for you. Type* and a space before your text, and Word will make a bulleted list.
Lists made with bullets are called bulleted lists. The HTML element name for a bulleted list is "unordered list", because the list items are not arranged in numerical order (as they would be in a numbered list). Usually, bullet points are used to list things.
A bullet list is used when creating a list of two or more items, and their order is not important. For example, a list of items you want to buy from a store could be shown in a bullet list. A number list should be used if you're creating a list of steps or directions where the order is important.
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;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With