ios 自定义的tabbar 怎么跳转
展开全部
UIViewController *controller=[[Tabbarcontroller alloc]init];
[self presentModalViewController:controller animated:YES];
在TabbarController.h中
@property(strong,nonatomic) UITabBarController *controller;
然后是在TabbarController.m中的
@synthesize controller;
-(id) initWithNibName(NSString *)nibNameOrNil bundle:(NSBundle *)nibBoundleOrNil
{
self=[super initWithNibName:nibNameOrNil bundle:nibBoundleOrNil];
UIViewController *first=[[First alloc]initWithNibName:@"First" bunlde:nil];
UIViewController *second=[[Second alloc]initWithNibName:@"Second" bunlde:nil];
controller=[[UITabBarController alloc]init];
controller.viewControllers=[NSArray arrayWithObjects:first,second,nil];
[self.view addSubView:controller.view];
if(self){
}
return self;
}
[self presentModalViewController:controller animated:YES];
在TabbarController.h中
@property(strong,nonatomic) UITabBarController *controller;
然后是在TabbarController.m中的
@synthesize controller;
-(id) initWithNibName(NSString *)nibNameOrNil bundle:(NSBundle *)nibBoundleOrNil
{
self=[super initWithNibName:nibNameOrNil bundle:nibBoundleOrNil];
UIViewController *first=[[First alloc]initWithNibName:@"First" bunlde:nil];
UIViewController *second=[[Second alloc]initWithNibName:@"Second" bunlde:nil];
controller=[[UITabBarController alloc]init];
controller.viewControllers=[NSArray arrayWithObjects:first,second,nil];
[self.view addSubView:controller.view];
if(self){
}
return self;
}
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询