Showing posts with label iPhone. Show all posts
Showing posts with label iPhone. Show all posts

14 July 2010

iPhone - Flipping a view

Pretty simple. This code worked great for me, after I figured out that the front view and back view need to be on a superview, which is what actually gets flipped.

Also try with UIViewAnimationTransitionCurlUp.

16 June 2010

[UILabel sizeToFit]

This method is great for making a text label's height and width fit the text that's inside it.


CGRect frame = CGRectMake(0, 0, 320, 480);
UILabel *myLabel = [[UILabel alloc] initWithFrame:frame];
myLabel.text = @"Any size text string";
[myLabel sizeToFit];


Thanks to the Stack Overflow community for teaching me about this.