0
所以我設法加載另一個視圖時,有人按下按鈕,但它加載到高。 `我不知道爲什麼會發生這種情況。差別正是頂級酒吧高。這是我的代碼: 在委託我有:在狀態欄中繪製的視圖
- (void)flipToAbout {
AboutViewController *aaboutView = [[AboutViewController alloc] initWithNibName:@"AboutViewController" bundle:nil];
[self setAboutController:aaboutView];
[aaboutView release];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:window cache:YES];
[homeController.view removeFromSuperview];
[self.window addSubview:[aboutController view]];
[UIView commitAnimations];}
在有關視圖我沒有改變anything.Please告訴我什麼是problemm .Thanks。
試圖在視圖中執行此操作: - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:CGRectMake(0,20,320,460)]; if(self){//初始化代碼。 } return self; }但它什麼都不做。 – flaviusilaghi 2011-04-08 17:16:10
這可能是因爲你正在從一個筆尖加載視圖,所以使用-initWithCoder:而不是-initWithFrame:來完成初始化。相反,加載'aboutView.view.frame = CGRectMake(0,20,320,460);'加載視圖後,或者在將其添加到窗口後。 – Caleb 2011-04-08 18:03:25