0
我有這樣的動畫塊:動畫MapView的屏幕周圍
[UIView animateWithDuration:10 animations:^{
CGPoint centerLeft;
centerLeft.x = self.leftMapPane.center.x - 100;
centerLeft.y = self.leftMapPane.center.y;
CGRect leftMove = CGRectMake(self.leftMapPane.frame.origin.x - 100, self.leftMapPane.frame.origin.x, self.leftMapPane.frame.size.width, self.leftMapPane.frame.size.height);
[self.leftMapPane setFrame:leftMove];
[self.leftMapPane setCenter:centerLeft];
}];
但由於某些原因,雖然它得到的動畫塊裏面,它不動mapViews我在屏幕上左右。 應該指出的是,我並不是在談論移動地圖,而是包含地圖的視圖,也就是mapview。
有什麼想法?
我創建了一個帶有地圖視圖(leftMapPane)的簡單項目,並複製並粘貼了你的代碼,並且動畫工作正常。所以你的動畫調用很好,問題必須在你的代碼的另一部分。你從哪裏調用動畫功能? – nebs
只是從viewDidLoad。 – barndog
請參閱下面的答案。 – nebs