我已将 20 个子视图逐行添加到滚动视图中。
代码片段
yPos=0;
for (int i=0; i<20; 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;
}
现在如何在这 20 个子视图上添加另一个子视图?