UIView, UILabel, and sizeToFit
UIView, UILabel, and sizeToFit
- Subject: UIView, UILabel, and sizeToFit
- From: Matt James <email@hidden>
- Date: Tue, 27 Apr 2010 21:56:32 -0400
Hi everyone,
This is probably a stupid question, but I can't seem to figure it out for
the life of me. On the iPad, I'm using a UIView containing a UILabel. I
set the text property of the UILabel (which seems to update display right
away) and then say [label sizeToFit] and [containerView sizeToFit] in the
hopes that it will update the widths of both views to accommodate whatever
text was inserted.
Unfortunately, NSLog-ing the values of label.frame.size.width and
containerView.frame.size.width shows that the values are "0".
This leads me to 2 questions.
1) As I understand the documentation, it should work the way I'm using it.
If that doesn't work, what does sizeToFit do?
2) How do I get the behavior I'm looking for?
Thanks for any help you can provide!
-
Matt James
_______________________________________________
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