我有一个滚动视图,其中正在使用 for 循环动态显示图像……现在我想制作带有边框的滚动视图图像……我在这个 xcode 环境中是全新的。我用谷歌搜索了这些东西,但无法理解它是如何做到的将完成..我的代码如下
scr.contentSize = CGSizeMake(0, 0);
for(int i=1;i<6;i++)
{
UIImageView *image = [[UIImageView alloc] initWithFrame:CGRectMake(x+0, 0, 320, 460)];
[image setImage:[UIImage imageNamed:[NSString stringWithFormat:@"n5%d.png",i]]];
[scr addSubview:image];
x+=320;
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)];
tapGesture.numberOfTapsRequired = 1;
tapGesture.delegate = self;
image.userInteractionEnabled = YES;
[image addGestureRecognizer:tapGesture];
}
_detailDescriptionLabel.text=@"Bhavik";
[self.view addSubview:scr];
self.title=@"krish";
scr.pagingEnabled=YES;
scr.contentSize = CGSizeMake(320*5, 300);
任何人都可以给我一些解释的建议,以便将来也有帮助..