UITextView Word Wrap

Discussion in 'iOS Programming' started by ray648, Aug 23, 2010.

  1. ray648
    Expand Collapse
    macrumors regular

    Jan 10, 2008
    I've got an ipad app with a UITextView containing a lot of text. The default is that word wrap is on, and lines are always broken between words. Is there any way of making this a bit less clever? I want it to just break lines at the point they reach the edge of the TextView, in the middle of a word if thats where it happens. Anyone know of a way to achieve this?
  2. PhoneyDeveloper
    Expand Collapse
    macrumors 68030


    Sep 2, 2008
    Some of the UIKit views have a UILineBreakMode property, which you could set to UILineBreakModeCharacterWrap. As far as I can tell UITextView has no such property, including its base class and adopted protocols. I don't see any way to change the way it wraps text.

    If your text is not editable then you could use a UILabel.
  3. ray648
    Expand Collapse
    thread starter macrumors regular

    Jan 10, 2008
    Thanks. Guess I'll have to find another way to do it.
  4. robbieduncan
    Expand Collapse
    Moderator emeritus


    Jul 24, 2002

Share This Page