2014-09-04 70 views
0

在我的iOS窗口的默認視圖中,我有兩個元素。一個是UIImageView,另一個是UIButton在iOs中調用按鈕setBackgroundImage後,UIImageView位置發生變化

當應用程序啓動時,我通過動畫self.basebar.center屬性來移動UIImageView[UIView animateWithDuration...]。它是這樣做的,並保持在基本上是y - 60pt的設定位置。

[UIView animateWithDuration:0.3 
delay:0.1 
options:UIViewAnimationOptionBeginFromCurrentState 
animations:^{ 
self.basebar.center = CGPointMake(self.basebar.center.x, self.basebar.center.y + 60.f); 
} 
completion:nil ]; 

在同一視圖中爲myUIViewImageUIButton

當我點擊UIButton時,動作會做它應該做的事情,只是爲按鈕設置不同的背景圖像......但是self.basebar.center會返回到原始位置?

這是爲什麼而引起的任何想法 - 是誰查看正在重繪和原self.basebar.center

回答

0

自動佈局...佈局是恢復到原來的佈局被點擊按鈕時被..