#import <UIKit/UIKit.h>
@interface quartzViewController : UIViewController {
IBOutlet UIView *myView;
}
@end
#import "quartzViewController.h"
@implementation quartzViewController
-(void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSelectFont(context, "Arial", 24, kCGEncodingFontSpecific);
CGContextSetTextPosition(context,80,80);
CGContextShowText(context, "hello", 6);
//not even this works
CGContextShowTextAtPoint(context, 1,1, "hello", 6);
}
- (void)viewDidLoad {
[myView setNeedsDisplay];
[super viewDidLoad];
}
我需要对笔尖进行任何更改吗?
谢谢