2012-01-14 60 views

回答

6

如果你只是想要的路徑,那麼一定要做到這一點很容易嗎?

UIBezierPath *roundedRect = [UIBezierPath bezierPathWithRoundedRect:layer.bounds 
                 cornerRadius:layer.cornerRadius]; 

如果您需要在CoreGraphics使用這個然後就問這是CGPath

roundedRect.CGPath; 
+0

我明白我可以重新創建路徑,但想知道如果我能像我說的,而不是將其解壓縮。 – Ana 2012-01-14 22:04:37

+0

不,你不能。雖然Paul.s的代碼會給你一個等價的路徑。爲什麼? – 2012-01-14 22:11:22

+0

不是我可以從文檔中輕鬆看到 – 2012-01-14 22:12:18