1. CGRectMake (origin. x, origin. y, size. width. Size. height) defines the rectangle in the code.
For example, [imageView setFrame: CGRectMake (,)];
If you get its own framework, CGFloat x (y) = imageView. frame. origin. x (imageView. frame. origin. y)
Get size: imageView. frame. size. width (imageView. frame. size. height)
Eg:
UILabel * label = [[UILabel alloc] initWithFrame: CGRectZero];
Label. frame = CGRectMake (0, 0,200, 50 );
Label. center = CGPointMake (160,240 );
Label. text = @ "hello everyone ";
Label. textColor = [UIColor redColor];
Label. font = [UIFont fontWithName: @ "Arial" size: 37];
NSLog (@ "% f", label. frame. origin. x );
NSLog (@ "% f", label. frame. origin. y );
NSLog (@ "% f", label. frame. size. height );
NSLog (@ "% f", label. frame. size. width );
NSLog (@ "% f", label. center. x );
NSLog (@ "% f", label. center. y );
2. NSStringFromCGReot (someCGRect) converts the CGRect structure into a formatted string.
3. CGRectFromString (aString) is represented by a string to restore the rectangle.
4. CGRectlnset (aRect) is used to create a smaller or larger rectangle (with the same center point ). Use positive embedded values to represent smaller rectangles, and use negative embedded values to represent larger rectangles.
5. CGRectIntersectsRect (rect 1. feet 2) can determine whether the rectangular structure is cross and whether the two rectangular objects overlap.
Check whether two icons are in conflict.
6. CGRectZero is a rectangle constant with a height and a width of 0 and a position of (0, 0. You can use this constant to create a border but you are not sure about the border size or position.