• 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
Re: How to vertically align the text in a text field
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to vertically align the text in a text field


  • Subject: Re: How to vertically align the text in a text field
  • From: "M. Uli Kusterer" <email@hidden>
  • Date: Tue, 15 Feb 2005 13:01:19 +0100

At 12:05 Uhr +0530 15.02.2005, JanakiRam wrote:
I Have an NSTextField whose frame will be changing dynamically, now my requirement is to vertically align the text at all times when the frame changes . How to achieve this.

Several options:

1) subclass NSTextField and override its drawRect: method so it centers its NSTextCell vertically.

2) Make your NSTextView a subview of an NSView that draws a "text field border" around itself, then set the text view's resize struts so it stays centered in its superview. Of course the text view itself wouldn't draw a border around itself.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
References: 
 >How to vertically align the text in a text field (From: JanakiRam <email@hidden>)

  • Prev by Date: Re: NSTimer crashes after invalidation
  • Next by Date: Re: Formatting integer value
  • Previous by thread: How to vertically align the text in a text field
  • Next by thread: Lost dirty window ability???
  • Index(es):
    • Date
    • Thread