1
iPhone開発でUIButtonを使用してビューを変更する方法を教えてください。私はツールバーを使いたくない。あなたはUIButtonを使用してビューを変更する方法
iPhone開発でUIButtonを使用してビューを変更する方法を教えてください。私はツールバーを使いたくない。あなたはUIButtonを使用してビューを変更する方法
このような何か:
- (IBAction)switchViews:(id)sender {
if (self.vc1 == nil) {
self.vc1 = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];
[self.vc2 removeFromSuperview];
[self.view addSubView:vc1];
vc2 = nil;
}
else {
self.vc2 = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];
[self.vc1 removeFromSuperView];
[self.view addSubView:vc2];
vc1 = nil;
}
}
はどうもありがとうございました! – Shawn