我有一个滚动视图,并在那里动态显示图像的for循环...现在我想让它的边界滚动视图图像..我是这个xcode environment.i全新的东西,但Google不能理解它将如何done..my代码如下如何在xcode 4.5中的UIscrollview中显示图像边框?
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];
}
[email protected]"Bhavik";
[self.view addSubview:scr];
[email protected]"krish";
scr.pagingEnabled=YES;
scr.contentSize = CGSizeMake(320*5, 300);
谁能给我提供了一些解释建议所以它会在将来也帮助..
做你想做的边框添加到ImageView的? – 2013-03-22 06:54:24
是的,我想添加边界到UIImageView – 2013-03-22 06:55:00
然后Rajan的答案会做到这一点 – 2013-03-22 06:56:10