我有一個視圖,它有一個UIWebView和一個OptionsPane(具有自定義視圖的自定義UIViewController)。Iphone SDK - 動畫子視圖
我希望當顯示視圖時,對於選項窗格(位於主視圖的頂部)將FLIP放置到位。我正在使用該代碼,並且得到了一個奇怪的結果。
第一次顯示視圖時,選項窗格似乎已經可見...當我在我的navController上按BACK時,再次拉起視圖,動畫完美地工作。
任何人都可以對這個主題有所瞭解嗎?
- (void)viewDidLoad {
[super viewDidLoad];
optionsPane=[[OptionsPaneController alloc] initWithNibName:@"OptionsPane" bundle:nil];
}
- (void)viewWillAppear:(BOOL)animated {
[optionsPane.view removeFromSuperview];
[self checkOptionsVisible];
}
-(void)checkOptionsVisible{
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:[optionsPane view] cache:YES];
[[self view] addSubview:[optionsPane view]];
[theWebView setFrame:CGRectMake(0,87,320,230)];
[[optionsPane view] setFrame:CGRectMake(0,0,320,87)];
[UIView commitAnimations];
}
編者注。請不要更改OP發佈的問題的實際文本,除非對問題至關重要。通過編輯我的文本,你實際上改變了這個問題。保留你的標籤,回滾語言。 – Dutchie432 2012-10-22 10:52:12