- (void) grupButtonTappedwithObj:(UIButton *)button
{
CGFloat viewHeight = [[[self.arrGroup objectAtIndex:button.tag] objectForKey:@"kategoriler"] count] * BUTTON_HEIGHT;
for (UIView *theView in self.scrGruplar.subviews)
{
if ([theView isKindOfClass:[UIButton class]])
{
if (theView.tag < button.tag)
{
theView.frame = CGRectMake(0, (BUTTON_HEIGHT * theView.tag), BUTTON_WIDTH, BUTTON_HEIGHT);
}
else if (theView.tag > button.tag)
{
theView.frame = CGRectMake(0, (BUTTON_HEIGHT * theView.tag) + viewHeight, BUTTON_WIDTH, BUTTON_HEIGHT);
}
else
{
theView.frame = CGRectMake(0, button.tag * BUTTON_HEIGHT, BUTTON_WIDTH, BUTTON_HEIGHT);
}
}
else if ([theView isKindOfClass:[UIView class]])
{
self.categoryView.frame = CGRectMake(0, (button.tag * BUTTON_HEIGHT)+ BUTTON_HEIGHT, BUTTON_WIDTH, [[[self.arrGroup objectAtIndex:button.tag] objectForKey:@"kategoriler"] count]*BUTTON_HEIGHT);
}
}
self.scrGruplar.contentSize = CGSizeMake(265, self.categoryView.frame.size.height + [self.arrGroup count]*46 + ([self.arrGroup count]-1)*14);
}