• 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
UIView, UILabel, and sizeToFit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: UIView, UILabel, and sizeToFit
      • From: Fritz Anderson <email@hidden>
  • Prev by Date: Cocoa Newbie & MySQL
  • Next by Date: Re: UIScrollView Sizing
  • Previous by thread: Re: Cocoa Newbie & MySQL
  • Next by thread: Re: UIView, UILabel, and sizeToFit
  • Index(es):
    • Date
    • Thread