我有一個使用PocketSVG從SVG文件製作的UIBezierPath。如何重新調整和放置UIBezierPath?
我想包括我在CGShapeLayer UIBezierPath,並使用此代碼:
self.centerIconShapeLayer = [CAShapeLayer layer];
self.centerIconShapeLayer.frame = CGRectMake(5, 8, self.frame.size.width - 10, self.frame.size.height - 16);
self.centerIconShapeLayer.fillColor = [[UIColor redColor] CGColor];
self.centerIconShapeLayer.contentsRect = CGRectMake(600, 0, 100, 100);
self.centerIconShapeLayer.contentsGravity = kCAGravityCenter;
[self.layer addSublayer:self.centerIconShapeLayer];
self.centerIconShapeLayer.path = myBezierPath.CGPath;
這似乎並沒有工作,雖然,和我的外形並不就該改變大小或位置的任何這些設置。
有沒有什麼我失蹤,在功能方面將其移入位置?
我這樣做。因爲我使用PocketSVG來允許我使用矢量,所以我得到了一個UIBezier路徑來使用。我可以直接從該圖層的內容中獲取信息嗎? – Andrew 2013-04-10 23:02:40
是的,堅持下去,我正在爲你編寫代碼。 – matt 2013-04-10 23:07:30