UILabel
テキスト付きの「メモ」(サブクラス化)を表示しているiPadアプリがあります。次のノートに移動するには、次のノートを右からスライドさせながら、画面から左にスライドさせてください。どちらかのアニメーションを動作させることはできますが、両方を同時に動作させることはできません。
これが私のコントローラーのコードです:
- (void)slideOutLeft {
// create the new note
flSlidingNote *newNote = [[flSlidingNote alloc] init];
newNote.text = @"blah blah";
CGRect newFrame = CGRectMake(1000, 70, 637, 297); // off the right
newNote.frame = newFrame;
[self.view addSubview:newNote];
// slide off the current one
CGRect currentFrameEnd = noteLabel.frame; // noteLabel is the existing note
currentFrameEnd.origin.x = 0 - noteLabel.frame.size.width; // off the left
[UIView animateWithDuration:1.0 animations:^{
noteLabel.frame = currentFrameEnd;
} completion:nil];
}
noteLabel
まったくアニメートしません。addSubview:newNote
私がその部分をコメントアウトすると、それはします。私はまだ比較的新しいので、おそらく単純なものです。
問題は、アニメーション化されているかどうかに関係なく発生newNote
します(コードスニペットではアニメーション化されていません)。