Wednesday 8 June 2011

Clicking The Button Show Another View

- (void)viewDidLoad
{
UIButton *whoButton=[UIButton buttonWithType:UIButtonTypeRoundedRect];
whoButton.frame=CGRectMake(20.0, 240.0, 80.0, 25.0);
[whoButton setBackgroundColor:[UIColor blueColor]];
[whoButton setTitle:@"WHO" forState:UIControlStateNormal];
[whoButton setTitleColor:[UIColor purpleColor] forState:UIControlStateNormal];
whoButton.font=[UIFont fontWithName:@"HelveticaNeue-Bold" size:12];
[whoButton addTarget:self action:@selector(whoButton:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:whoButton];
}
-(void)whoButton:(id)sender
{
WhoWeAreViewController *WhoWeAreUsController=[[WhoWeAreViewController alloc]init];
[[self navigationController] pushViewController:WhoWeAreUsController animated:YES];
}

No comments:

Post a Comment