的CGRectEdge枚举用于提供信息给划分成矩形子矩形呼叫,这两个调用在< CoreGraphics中/ CGGeometry.h >和MKMapRectDivide在<MapKit/MKGeometry.h>是CGRectDivide。
/* Make two new rectangles, `slice' and `remainder', by dividing `rect' with
a line that's parallel to one of its sides, specified by `edge' -- either
`CGRectMinXEdge', `CGRectMinYEdge', `CGRectMaxXEdge', or
`CGRectMaxYEdge'. The size of `slice' is determined by `amount', which
measures the distance from the specified edge. */
void CGRectDivide(CGRect rect, CGRect *slice, CGRect *remainder,
CGFloat amount, CGRectEdge edge);
void MKMapRectDivide(MKMapRect rect, MKMapRect *slice, MKMapRect *remainder, double amount, CGRectEdge edge) NS_AVAILABLE(10_9, 4_0);
绿色检查,因为这是更好的2类似的答案,只是因为它有更多的信息。但这两个答案都错过了让我困惑的东西。从文档中,我认为CGRectEdge以某种方式指定了矩形的坐标。我现在明白它的价值只是指定矩形的四个边中的一个。它是用于指定四个边中的一个的数字代码。它不给任何事情的坐标。文件中的措辞似乎是错误的。它不应该说“建立矩形边的坐标”,因为它不包含坐标。 – RobertL 2014-09-02 17:50:15