PDA

View Full Version : Show tab on the textview




oceandrive
Jul 23, 2009, 05:16 PM
I have a small piece of code (Example Below) which is well formated with Tab's and new lines. But when I view this code on a text view it does not show the tab's, but it does show the new lines.


@interface Animal : NSObject
{
NSString *name;
NSString *description;
NSString *imageURL;
}


What do I need to do to make sure the text is tabbed.

Thanks for the help.



PhoneyDeveloper
Jul 23, 2009, 05:39 PM
UITextView doesn't support tabs.

Choices to implement this include:

Possibly you could convert the tabs to spaces and use a fixed width font and then display with a UITextView. Actually this isn't simple.

Use UIWebView.

Use your own drawing code to draw each line into a view using the UIStringDrawing methods. Also complicated.