我試圖運行一個例子來測試這個函數。我在storyBoard中有一個標籤,並且在視圖控制器中引用了標籤的底部約束。當我使用按鈕時,我希望標籤隨動畫一起移動,但它在沒有它的情況下移動。下面是按鈕的代碼:AnimateWithDuration無法正常工作
- (IBAction)sd:(id)sender {
[UIView animateWithDuration:0.5f animations:^{
self.constraint.constant += 50;
}];
}
我知道如何在迅速的使用它,但我的目標C有問題,我知道這將是隻是一個小錯誤...任何幫助嗎?
謝謝,它解決了問題 –