的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