can we get the touched subview properties from scroll view in ios
i have added 20 subviews to scrollview line by line as rows
` yPos=0; for (int i=0; i<24; i++) {
UIView *timeView=[[UIView alloc]initWithFrame:CGRectMake(71, yPos,
909, 60)];
timeView.userInteractionEnabled=TRUE;
timeView.exclusiveTouch=YES;
timeView.tag=i;
NSLog(@"sub vieww tag=:%d",timeView.tag);
timeView.backgroundColor=[UIColor whiteColor];
UILabel *lbltime=[[UILabel alloc]initWithFrame:CGRectMake(0, 0, 70, 60)];
lbltime.text=@"VIEW HERE";
lbltime.textColor=[UIColor grayColor];
// [timeView addSubview:lbltime];
[scrlView addSubview:timeView];
yPos=yPos+61;
}
` Now when ever i taped on a subview i am not getting the tapped subview
properties.
like coordinates.it giving parent view coordinates
i enabled subview UserInteractionEnabled to Yes can any one tell me how to
get tapped subview coordinate and tag value.
No comments:
Post a Comment