2012-11-23 20 views
1

我正在使用iPhone SDK 4的iphone應用,半的TabBar的不可見:((

我的應用程序開始於一個普通視圖

當用戶按下一個按鈕,它進入下一個視圖!這種觀點必須具有Tabbar

第一視圖==按鈕==>第二個視圖(具有的TabBar)

這是我的SecondviewController.m

#import "SecondViewController.h" 

@implementation SecondViewController 

@synthesize lab,tabbar; 

- (void)viewDidLoad { 
    [super viewDidLoad]; 
    [self.view addSubview:tabbar.view]; 

} 
- (void)didReceiveMemoryWarning { 
    // Releases the view if it doesn't have a superview. 
    [super didReceiveMemoryWarning]; 

    // Release any cached data, images, etc that aren't in use. 
} 

- (void)viewDidUnload { 
    [super viewDidUnload]; 
    // Release any retained subviews of the main view. 
    // e.g. self.myOutlet = nil; 
} 


- (void)dealloc { 
    [super dealloc]; 
    [lab release]; 
    [tabbar release]; 
} 

@end 

它的作品,但我親愛的TabBar的下半部分是不可見的。

+0

你可以設置你的NIB正確..? –

+0

http://stackoverflow.com/questions/12460013/remove-uitabbar-controller/12460244#12460244 – Rajneesh071

+0

你的問題的解決方案是什麼? – Rajneesh071

回答

1

這是因爲您的導航欄或已實施的狀態欄,因此Tabbar會低於屏幕原始高度(即480像素)。在您的筆尖文件中,單擊視圖並在模擬的指標中嘗試將頂部欄更改爲無並查看。也許這會有所幫助!!

0

嗨嘗試添加你的標籤欄主窗口就會出現像

[[[[UIApplication sharedApplication] windows] lastObject] addSubview: tabbar.view];