私のビューには 1 つの UITableView があります。私の UITableView の名前は tblTask です。
ビューの x 座標と y 座標を取得するために touchesBegan メソッドを使用しています。
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
CGPoint location = [touch locationInView:self.view];
NSLog(@"point........ %f .. %f",location.x,location.y);
}
しかし、tbltask からタッチ イベントを開始すると。tbltask がメイン ビューのサブビューであっても、location.x と location.y は返されません。
テーブルのスクロールビューも無効にしようとしましたが、何も起こりません。
これを設定すると。
tbltask.userInteractionEnabled=NO;
その後、座標が表示されますが、tbltask インタラクションが有効になっている場合でもビューの座標が必要です。