1

私はiphoneiPhoneSDK4を使用してアプリケーションを作成しています

私のアプリケーションは通常のビューから始まります!

そして、ユーザーがボタンを押すと、次のビューに移動します。このビューにはTabbar

最初のビュー==ボタン==>2番目のビュー(タブバー付き)

これは私の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

動作しますが、親愛なるタブバーの下半分が表示されません。

4

2 に答える 2

1

これは、タブバーが画面の元の高さ、つまり 480 ピクセルを下回っているために実装されているナビゲーション バーまたはステータス バーが原因です。nibファイルでビューをクリックし、シミュレートされたメトリックでトップバーをなしに変更して確認してください。たぶんこれが役立つでしょう!!。

于 2012-11-23T06:00:40.827 に答える
0

こんにちは、タブバーをメインウィンドウに追加してみてください。次のように表示されます

[[[[UIApplication sharedApplication] windows] lastObject] addSubview: tabbar.view];
于 2012-11-23T06:51:31.250 に答える