I have a NSTextField
(Label) in a NSView
. Value in the label changes dynamically. I would like to set the Frame of the TextField always centered with respect to view.Is there any way to calculate the pixels or size occupied by the text in the texfield so that I can increase the size of the textfield to fit the text and change the origin so that textfield is always centered.
I would like to align the NSTextField
to be Centered with in a View and Change the origin and frame of the textfield by calculating the size occupied by text. How to calculate the size occupied by the text in the TextField ?