I have an UIButton and i have assigned a UIImage to it. The UIButton is on my UITableViewCell and it detects a touch only if i tap on the left top side of the UIButton! Is anyone had this issue before? Any help appreciated.
This is my code:
UIButton *indicatorlabel =
[[UIButton alloc]
initWithFrame:
CGRectMake(280,20,22,22)];
indicatorlabel.tag = INDICATOR_LABEL_TAG1;
UITapGestureRecognizer *tapGesture24449 =[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(labelTapShare:)];
[indicatorlabel addGestureRecognizer:tapGesture24449];
[indicatorlabel setTitle:@"shareit" forState:UIControlStateNormal];
indicatorlabel.showsTouchWhenHighlighted=TRUE;
indicatorlabel.userInteractionEnabled=TRUE;
[indicatorlabel setImage:[UIImage imageNamed:@"Share.png" ] forState:UIControlStateNormal];
[cell.contentView addSubview:indicatorlabel];
No other view is overlaying the UIButton i have checked it.
Thanks
Sorry guys i was wrong i have created another UILabel at the same coordinates.