我想畫的2個pixels..I一行寫了下面的代碼,但它並沒有畫上任何線或任何view..Plzz幫我對此還是告訴我的錯誤在此代碼...在代碼pointToBeShown是CGPoint .....廣東話繪製iphone線
- (void)drawRect:(CGRect)rect {
// Drawing code.
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetLineWidth(context, 2.0);
CGContextSetStrokeColor(context, currentColor.CGColor);
pointToBeShown.x = 30;
pointToBeShown.y = 449;
CGContextMoveToPoint(context, pointToBeShown.x, pointToBeShown.y);
CGContextAddLineToPoint(context, (pointToBeShown.x + 1),(pointToBeShown.y + 1));
CGContextStrokePath(context);
}
是您的代碼實際上是被稱爲提到 更新? –
而且你的顏色與背景顏色不同? – TheEye