鉴于标签栏基于应用程序?
-
22-09-2019 - |
题
我的新iphone development.I已经创建基于application.Now我想标签栏在view.The标签栏的第一视图是一个表,视图和所述第二视图的视图是Web-view.All的教程只是标签栏基于application.Since我使用视图基于应用程序,我发现它真的hard.How通过接口builder.please引导me.Any实例教材会更useful.Please帮我out.Thanks实现它解释。
解决方案
尝试这一个。此代码为程序创建一个标签栏的应用程序。所以单击该按钮就会打开视图中的标签栏。
-(IBAction) clkBtn:(id) sender
{
UITabBarController *tabbar1 = [[UITabBarController alloc] init];
firstViewController *first = [[firstViewController alloc] initWithNibName:@"firstViewController" bundle:nil];
UINavigationController *tabItem1 = [[[UINavigationController alloc] initWithRootViewController: first] autorelease];
secondViewController *second = [[secondViewController alloc] initWithNibName:@"secondViewController" bundle:nil];
UINavigationController *tabItem2 = [[[UINavigationController alloc] initWithRootViewController: second] autorelease];
tabbar1.viewControllers = [NSArray arrayWithObjects:tabItem1, tabItem2,nil];
[self.view insertSubview:tabbar1.view belowSubview: first.view];
[self presentModalViewController:tabbar1 animated:YES];
}
谢谢,
好运。
不隶属于 StackOverflow