TabbarControllerでViewcontrollerをプッシュするには? Viewcontroller'XIB で、UITabbarController を作成しました。次に、この ViewController をプッシュしますが、UITabbarController は表示されません。これは私のコードです: *Viewcontroller.h:
@interface StatusViewController : UIViewController<UITabBarControllerDelegate>
{
IBOutlet UITabBarController *tabBarController;
IBOutlet UIButton *UploadButton;
IBOutlet UIButton *ConvertorButton;
IBOutlet UIButton *CompletedButton;
}
@property (nonatomic, retain) IBOutlet UITabBarController *tabBarController;
@end
*Viewcontroller.m:
@implementation StatusViewController
@synthesize tabBarController ;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
[self createTabView];
}
-(void)createTabView
{
....
....
[ConvertorButton addSubview:Label3];
[CompletedButton setTag:3];
[CompletedButton setImage:[UIImage imageNamed:@"Overlay-2.png"] forState:UIControlStateNormal];
[CompletedButton setImage:[UIImage imageNamed:@"background.jpg"] forState:UIControlStateSelected];
[CompletedButton setImage:[UIImage imageNamed:@"background.jpg"] forState:UIControlStateHighlighted];
//[[CompletedButton layer] setBorderWidth:2.0f];
// [[CompletedButton layer] setBorderColor:[UIColor grayColor].CGColor];
UILabel *Label4=[[UILabel alloc]initWithFrame:CGRectMake(6, 8, 70, 30)];
[Label4 setTextAlignment:UITextAlignmentCenter];
[Label4 setText:@"Completed"];
Label4.backgroundColor=[UIColor clearColor];
[Label4 setFont:[UIFont fontWithName:@"Helvetica-Bold" size:12]];
Label4.textColor=[UIColor whiteColor];
[CompletedButton addSubview:Label4];
// [self selectTab:1];
[self.view addSubview:UploadButton];
[self.view addSubview:ConvertorButton];
[self.view addSubview:CompletedButton];
}
ご協力いただきありがとうございます