UIButtonがあり、UIImageを割り当てました。UIButtonはUITableViewCellにあり、UIButtonの左上をタップした場合にのみタッチを検出します。誰かが以前にこの問題を抱えていましたか?助けていただければ幸いです。
これは私のコードです:
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];
私がチェックしたUIButtonをオーバーレイしているビューは他にありません。
ありがとう