我正在使用GMGridview的應用程序中工作。我在cellforItems方法中添加了按鈕。 -翻轉動畫不能在GMGridview中工作
(GMGridViewCell *)GMGridView:(GMGridView *)gridView cellForItemAtIndex:(NSInteger)index
{
NSLog(@"Creating view indx %d", index);
CGSize size = [self GMGridView:gridView sizeForItemsInInterfaceOrientation:[[UIApplication sharedApplication] statusBarOrientation]];
GMGridViewCell *cell = [gridView dequeueReusableCell];
if (!cell)
{
cell = [[GMGridViewCell alloc] init];
cell.deleteButtonIcon = [UIImage imageNamed:@"close_x.png"];
cell.deleteButtonOffset = CGPointMake(-15, -15);
}
[[cell.contentView subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)];
btn = [UIButton buttonWithType:UIButtonTypeCustom];
[btn setTag:index];
[btn setFrame:CGRectMake(0, 0,size.width, size.height)];
NSLog(@"button frame is %@",btn);
[[btn layer] setBorderColor:[UIColor redColor].CGColor];
[[btn layer]setBorderWidth:2.0f];
[btn addTarget:self action:@selector(SegmentChange:) forControlEvents:UIControlEventTouchUpInside];
cell.contentView = btn;
//int btntag=btn.tag;
return cell;
後來我就用什麼方法來翻轉所有的按鈕,但它不工作,我想是當我點擊翻頁按鈕在GridView所有的按鈕應該flip.how我能做到這一點,倒裝代碼我用的就是這裏,
for(ll=0;ll<[Image_array count];ll++)
{
// [UIView setAnimationDelay:2.0];
[UIView beginAnimations:@"BackButton" context:nil];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
[UIView setAnimationDuration:12.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:btn cache:YES];
[UIView setAnimationDelegate:self];
[UIView commitAnimations];
[btn setImage:[UIImage imageNamed:nil] forState:UIControlStateNormal];
[arr_check replaceObjectAtIndex:ll withObject:@"uncheck"];
front = NO;
}
[_gmGridView reloadData];
沒能得到,使用定時器 – Purva 2012-08-14 12:48:21
@Purva:使用'timerWithTimeInterval'和用於翻轉UIView的方法。 – Devang 2012-08-14 12:52:29