我在一個NSMutableArray中有一堆uiimageview,而UIImageviews是關於視圖的動畫。但我無法弄清楚如何獲得任何圖像視圖的當前位置在數組中獲取uiimageview的中心
for(int i = 0; i < [myArray count]; i++){
UIImageView *temp = [myArray objectAtIndex:i];
NSLog(@"POSITION:%@",temp.center.x);
}
我在一個NSMutableArray中有一堆uiimageview,而UIImageviews是關於視圖的動畫。但我無法弄清楚如何獲得任何圖像視圖的當前位置在數組中獲取uiimageview的中心
for(int i = 0; i < [myArray count]; i++){
UIImageView *temp = [myArray objectAtIndex:i];
NSLog(@"POSITION:%@",temp.center.x);
}
你確定你的數組中有有效的UIImageViews嗎?
嘗試:
for(int i = 0; i < [myArray count]; i++){
UIImageView *temp = [myArray objectAtIndex:i];
NSLog(@"%@",temp);
}
你應該在日誌中看到類似這樣的:
<UIImageView: 0x...>
可能重複[移動一個UIImage的(http://stackoverflow.com/questions/862084/ move-an-uiimage) – Saphrosit 2012-03-11 01:45:05
老兄,這甚至不是我所要求的 – Matt 2012-03-11 01:57:07