我是iPhone新手,並且無法弄清楚如何使用Core Graphics。我用來測試的代碼是:如何在iPhone上使用Core Graphics繪製視圖
- (void)drawRect:(CGRect)rect{
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextClearRect(ctx, rect);
CGContextSetRGBStrokeColor(ctx, 255, 255, 0, 1);
CGContextStrokeRect(ctx, CGRectMake(195, 195, 60, 60)); }
我把它放在ViewController.m文件在默認視圖基於應用程序,但在應用程序運行時沒有任何反應。
你想要什麼來實現呢? – Jhaliya 2011-05-27 19:27:18