【发布时间】:2012-11-14 10:01:23
【问题描述】:
我是编程新手,我整晚都在寻找,很长时间以来都想弄清楚这一点。不能......我不想使用导航控制器,但我想做的是这个。
所以我的项目中有两个类。 1 类和 2 类。现在 Class1 中有一个按钮。如果按下此按钮,我希望屏幕转到 Class2。我得到的最接近的是创建一个父类,但是当我这样做时,按钮仍保留在两个类上。
- (IBAction)addScheduleB:(id)sender {
[UIView beginAnimations:@"View Curl" context:nil];
[UIView setAnimationDuration:1.00];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
if (self.firstScreen.view.superview ==nil){
if(self.firstScreen==nil) {
self.firstScreen = [[FirstScreen alloc] initWithNibName:@"FirstScreen" bundle:nil];
}
[self.config1.view removeFromSuperview];
[self.view insertSubview:self.firstScreen.view atIndex:0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.view cache:YES];
[self.config1.view removeFromSuperview];
[self.view insertSubview:self.firstScreen.view atIndex:0];
[sender setTitle:@"Switch To DVR"];
}
else{
if(self.config1 == nil){
self.config1 = [[Config1 alloc] initWithNibName:@"Config1" bundle:nil];
}
[self.firstScreen.view removeFromSuperview];
[self.view insertSubview:self.config1.view atIndex:0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:YES];
[self.firstScreen.view removeFromSuperview];
[self.view insertSubview:self.config1.view atIndex:0];
[sender setTitle:@"Switch To TV"];
}
[UIView commitAnimations];
}
我想删除父类,只保留两个类。
是否有可能在 class1 内有一个按钮,按下时会将我带到 class2 ???
【问题讨论】:
-
您想从一个视图转到另一个视图吗?
标签: ios xcode uiviewcontroller uibutton