I have a UITableView inside a UIView, lets call it view_A. There's a UIViewController, call it mainViewController. Inside it there is a UIButton. On tapping that button I add the view_A as a subview to mainViewController's view. The tableview has several menu items in it. The problem is the tableview is not responding to the touch correctly. I have to tap the cell long to make a selection. There's no gesture added on it. There's no other view covering it. It's absolutely bizzare, this behavior. Please take a look at the following code and point out what might be causing the trouble. This is the delegate implementation/presentations in mainViewcontroller:
-(void) showDropDownMenu: (UIButton *) sender
{
UINib *nib = [UINib nibWithNibName:@"DropDownMenuView" bundle:nil];
self.myView = [[nib instantiateWithOwner:self options:nil] objectAtIndex:0];
self.myView.hidden = NO;
self.myView.tag = 101;
self.myView.delegate = self;
self.myView.btnBack.hidden = YES;
CATransition *transition = nil;
transition = [CATransition animation];
transition.duration = 0.2;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype =kCATransitionFromBottom ;
transition.delegate = self;
[self.myView.layer addAnimation:transition forKey:nil];
[self.view addSubview:self.myView];
}
-(void) hideDropDownMenu
{
CATransition *transition = nil;
transition = [CATransition animation];
transition.duration = 0.2;//kAnimationDuration
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault];
transition.type = kCATransitionPush;
transition.subtype =kCATransitionFromTop;
transition.delegate = self;
[self.myView.layer addAnimation:transition forKey:nil];
self.myView.tag = 102;
[UIView commitAnimations];
}
-(void) navigateBack
{
}
-(void) themeSelected: (NSIndexPath *) indexPath
{
NSLog(@"%ld",(long)indexPath.item);
themeNumber = [NSString stringWithFormat:@"%li",(indexPath.row+1)];
[self setUpTheme];
}
0 comments:
Post a Comment