彩色画图
//
// DoodleViewController.m
// UI4practice
//
// Created by lanou on 12-12-17.
// Copyright (c) 2012年 lanou. All rights reserved.
//
#import "DoodleViewController.h"
#import "Doodleview.h"
@interfaceDoodleViewController ()
@end
@implementation DoodleViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
returnself;
}
-(void)loadView
{
self.view = [[Doodleviewalloc]initWithFrame:CGRectMake(0, 0, 320, 480)];
self.view.backgroundColor = [UIColorwhiteColor];
UIButton *undoButton = [UIButtonbuttonWithType:UIButtonTypeRoundedRect];
undoButton.frame = CGRectMake(0, 0, 80, 50);
[undoButton setTitle:@"撤销"forState:UIControlStateNormal];
[undoButton setTitleShadowColor:[UIColorblueColor] forState:UIControlStateNormal];
[undoButton.titleLabelsetShadowOffset:CGSizeMake(1, 2)];
undoButton.titleLabel.font = [UIFontsystemFontOfSize:30];
[undoButton addTarget:self.viewaction:@selector(undo) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:undoButton];
UIButton *getColorBtn = [UIButtonbuttonWithType:UIButtonTypeRoundedRect];
getColorBtn.frame = CGRectMake(240, 0, 80, 50);
[getColorBtn setTitle:@"清空"forState:UIControlStateNormal];
[getColorBtn setTitleShadowColor:[UIColorblueColor] forState:UIControlStateNormal];
[getColorBtn.titleLabelsetShadowOffset:CGSizeMake(1, 1)];
getColorBtn.titleLabel.font = [UIFontsystemFontOfSize:30];
[getColorBtn addTarget:self.viewaction:@selector(gColor) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:getColorBtn];
}
- (void)viewDidLoad
{
[superviewDidLoad];
// Do any additional setup after loading the view.
}
- (void)didReceiveMemoryWarning
{
[superdidReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end