I have developed a program with UIButtons with a navigationBar, now I do not know how to get a view by clicking a Button. When I click the button it should show me a different view. I also want to know after passing to the view, how to navigat开发者_JS百科e back to the before view programmatically?
You want pushViewController:animated:
and popViewControllerAnimated:
.
Take a look at the UINavigationController documentation.
Also u also develop something like this,
CGRect cg = CGRectMake(130.0, 220.0, 100.0, 30.0);
UIButton *btn = [[UIButton alloc] initWithFrame:cg];
btn.showsTouchWhenHighlighted = YES;
btn.backgroundColor = [UIColor blueColor];
[btn addTarget:self action:@selector(Showlbl:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn];
And give the proper button event in above part,
action:@selector(Showlbl:)
精彩评论