なぜ機能しないのかわかりません。
私がやりたいのは、viewDidLoad の単純な UIView アニメーションだけです。
これが私のコードです:
[UIView animateWithDuration:3.0f animations:^{
[self.headline setCenter:CGPointMake(0.0, 200.0)];
}];
何も起こりません。このような特定のオブジェクトでアニメーション メソッドを呼び出す一般的なアプローチをテストすると、次のようになります。
[UIView animateWithDuration:3.0f animations:^{
[self.headline setAlpha:0.0];
}];
できます!!!ビューを画面上で移動できないのはなぜですか? 最新の Xcode 4.5 を使用しています。
アドバイスをありがとう!
アップデート:
コードでビューを手動で追加すると、機能します。しかし、Interface Builder でアウトレットとして作成した UIView では機能しません。
UILabel *testLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.0, 0.0, 200.0, 100.0)];
testLabel.backgroundColor = [UIColor redColor];
[self.view addSubview:testLabel];
[UIView animateWithDuration:3.0 animations:^{
testLabel.center = CGPointMake(0.0, 200);
}];
だから明らかに私は.xibファイルで何か間違ったことをしています