One way is to print view frame into console:
NSLog(@"%@", NSStringFromCGRect(frame));...but sometimes it's easier and faster to just take a good look at objects. You can do this with temporary debug code:
2011-05-11 06:54:19.257 MyApp[10030:40b] [Line 10] {{0, 0}, {320, 30}}
label.backgroundColor = [UIColor redColor];
label.layer.borderColor = [[UIColor cyanColor] CGColor];
label.layer.borderWidth = 2;
I have definitely made use of "backgroundColor = [UIColor redColor]" multiple times when trying to lay out something just right!
ReplyDeleteI found random color addition to uicolor handy while debugging.
ReplyDeletePls refer http://www.cocoanetics.com/2011/05/visual-view-debugging/