//创建图片视图 UIImageView *img1=[[UIImageView alloc]initWithFrame:CGRectMake(floatcount, 12, 16, 16)]; //设置图片 img1.image=[UIImage imageNamed:@"homepic"]; //homepic.png [_scrollView addSubview:img1];
UIImageView *imgLine=[[UIImageView alloc]initWithFrame:CGRectMake(floatcount, 32, self.view.frame.size.width-floatcount*2, 1)]; imgLine.backgroundColor=[UIColor colorWithRed:223/255.0f green:223/255.0f blue:223/255.0f alpha:1.0]; [_scrollView addSubview:imgLine];