//创建图片视图
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];
本文详细介绍了如何在Objective-C中创建并添加图片视图和直线到视图控制器,包括设置图片和背景颜色的基本操作。
3814

被折叠的 条评论
为什么被折叠?



