имам 5 анимирани изображения в изглед на изображение и бих искал да позволя на потребителя да ги докосне на базата на ID по подразбиране и да го премести в друг изглед. Опитах се да добавя докосване с жестове, но изображението не се открива.
може ли някой да ми даде съвет?
РЕДАКТИРАНЕ: в крайна сметка не го използвах, вместо това зададох UIButton.
Благодаря ти :)
viewDidLoad
self.defaultID = [[NSMutableArray alloc] initWithObjects:@"7",@"9",@"11",@"27",@"6",nil];
self.defaultImageCaption = [[NSMutableArray alloc] initWithObjects:@"Ver",@"Green",@"Red",@"CF",@"Dwarf",nil];
//default image
imageViewTop.alpha = 1.0;
imageViewBottom.alpha = 0.0;
imageViewBottom = [[UIImageView alloc] initWithFrame:CGRectMake(0,44,320,367)];
imageViewTop = [[UIImageView alloc] initWithFrame:CGRectMake(0,44,320,367)];
singleDefaultTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(handleDefaultTap:)];
singleDefaultTap.numberOfTouchesRequired = 1;
imageViewTop.userInteractionEnabled = YES;
[imageViewTop addGestureRecognizer:singleDefaultTap];
imageViewTop.tag = 2000;
UIView *topView = [[UIView alloc] initWithFrame:CGRectMake(0,44,320,367)];
[topView addSubview:imageViewTop];
[self.view addSubview:imageViewTop];
[self.view addSubview:topView];
[self.view addSubview:imageViewBottom];
[self nextAnimation]
-(void)nextAnimation{
//picture loop
imageViewTop.image = imageViewBottom.image;
imageViewBottom.image = [imageArray objectAtIndex:[imageArray count] - 1];
[imageArray insertObject:imageViewBottom.image atIndex:0];
[imageArray removeLastObject];
imageViewTop.alpha = 1.0;
imageViewBottom.alpha = 0.0;
[UIView animateWithDuration:4.0
animations:^{
imageViewTop.alpha = 0.0;
imageViewBottom.alpha = 1.0;
}
completion:^(BOOL completed){
[self nextAnimation:stringsize.width];
}
];
действие
//покажете вашия сигнал...
NSLog(@"tapped");
flowerDetails = [[FlowerDetailViewController alloc] initWithNibName:@"FlowerDetailViewController" bundle:Nil] ;
Fr *fr = nil;
//натискане към детайлен изглед на цвете