4

I'm trying to display some java code in a UITextView, but I can't seem to create the same sort of hanging indentation that happens when coding in an IDE. Is there a simple way to do this, or will I have to mess around with Core Text in order to achieve this? How could it be achieved?

Will M.
  • 1,864
  • 17
  • 28
  • @JAL I guess that helps enough to merit redirecting to it. They aren't quite the same question as there is no user typing in this question, just text display. – Will M. Jun 12 '15 at 15:02
  • 1
    Oh sorry about that. To display text indented, you're going to want to use the ASCII escape characters. Check out this example: `yourTextView.text = @"public class Greeter {\n\tpublic static void main(String[] args) {\n\t\tSystem.out.println(\"Hello World!\");\n\t}\n}"` – JAL Jun 12 '15 at 15:10
  • Its ok, I think that the suggested duplicate provides enough information to solve the problem. – Will M. Jun 12 '15 at 15:12

0 Answers0