• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How can I "set tab stops" in a UITextView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How can I "set tab stops" in a UITextView?


  • Subject: How can I "set tab stops" in a UITextView?
  • From: Jay Reynolds Freeman <email@hidden>
  • Date: Sat, 18 Dec 2010 20:19:39 -0800

I would like to be able to control what is displayed in a UITextView when the text contains a "tab" character.  (I conjecture that if there is a mechanism to do that, it might be common to both UITextView and NSTextView, so if anyone knows anything about the latter, please speak up.)

More specifically:

Testing suggests that when there are tab characters in a text string being displayed in a UITextView, the system behaves as if "tab stops" were set every eight characters; that is, the next character after a tab is displayed at the next horizontal position that would correspond to it being preceded by a number of blank spaces that is a multiple of eight.

Is there a way to make that position be a multiple of something other than eight?  I do not need the full generality of completely adjustable tab stops, I just want to be able to change "eight" to another value.

My work-around is to watch text as it is typed or pasted into the view and deal with tabs there, on my own, or I suppose that if I were a dedicated masochist I could in principle override a "draw" method somewhere, but it would be easier to use a built-in mechanism if there is one.

I posted a query about this in the forums, and I have of course googled the usual suspects.

Thanks.

--  Jay Reynolds Freeman
---------------------
email@hidden
http://web.mac.com/jay_reynolds_freeman (personal web site)


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: NSTextView scrolls to top on Save
  • Next by Date: metadata to propertyList
  • Previous by thread: Re: NSTextView scrolls to top on Save
  • Next by thread: Re: How can I "set tab stops" in a UITextView?
  • Index(es):
    • Date
    • Thread