我有2個視圖。這個想法是從第二個視圖中選擇圖像並將其放置在第一個視圖上。 問題是我試圖添加平移手勢,它沒有響應或調用方法。請幫忙。在我的第一個觀點感謝UIImageView對UIPanGestureRecognizer手勢沒有響應
代碼
- (void)newStampImage: (UIImage *)inImage
{
stampImageView = [[UIImageView alloc]initWithImage:inImage];
UIPanGestureRecognizer *stampPanGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(moveStamp:)];
[stampPanGesture setMinimumNumberOfTouches:1];
[stampPanGesture setMaximumNumberOfTouches:1];
[stampImageView addGestureRecognizer:stampPanGesture];
stampImageView.center = self.view.center;
[self.view addSubview:stampImageView];
}
你設置了委託嗎?[stampPanGesture setDelegate:self]; – 0xDE4E15B 2012-02-22 08:03:46
@URLArenzo看到在這行代碼,並檢查目標** **:'[[UIPanGestureRecognizer的alloc] initWithTarget:自動作:@selector(moveStamp :)];' – samfisher 2012-02-22 09:58:19
@samfisher抱歉,是衝浪在移動設備。 – 0xDE4E15B 2012-02-22 14:07:59