ユーザーが間違ったデータを入力したことを警告するために、xcode でスライド バーを提供する必要があります。画面の上部に約1秒間表示してから消えるようにしたいので、アニメーションとコミットを備えたもの、このコードを書いて、それを除いてちょっとした仕事をします
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:.3];
CGPoint center = self.slidingView.center;
center.y += self.slidingView.frame.size.height;
self.errorLabel.center = center;
self.slidingView.center = center;
self.slidingView.transform = CGAffineTransformMakeRotation(0);
[UIView commitAnimations];
[self.view bringSubviewToFront:self.slidingView];
[self.view bringSubviewToFront:self.errorLabel];
これに関する問題は、最初はスライディングビューが別のUIViewの後ろに隠されていることですが、スライドダウンさせる必要があります。これはブルートな方法で表示されます(bringSubviewToFront.
何か案は。