Tuesday, 7 May 2013

What's the difference between frame and bounds in IOS



The frame  shows  the origin and size of a view in superview coordinates.
The bounds Shows the origin in the view’s coordinates and its size (the view’s content may be larger than the bounds size).




 NSLog(@"%@",NSStringFromCGRect(self.btnNext.frame));
 NSLog(@"%@",NSStringFromCGRect(self.btnNext.bounds));

OutPut :

frame :
2013-05-07 15:48:48.998 FirstStoryBoardViewController[1825:c07] {{51, 153}, {181, 44}}
Internal error [IRForTarget]: Couldn't rewrite external variable _ZZ52-[KMGViewController($__lldb_category) $__lldb_expr:]E19$__lldb_expr_result

Bounds :
2013-05-07 15:49:00.941 FirstStoryBoardViewController[1825:c07] {{0, 0}, {181, 44}}
Internal error [IRForTarget]: Couldn't rewrite external variable _ZZ52-[KMGViewController($__lldb_category) $__lldb_expr:]E19$__lldb_expr_result

No comments:

Post a Comment