<分区>
<分区>
我有一个 ScrollView ,其中使用 for 循环动态显示图像...现在我想制作带有边框的 ScrollView 图像..我在这个 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);
任何人都可以给我一些解释的建议,以便将来也有帮助..
最佳答案
你可以这样做:
//you need this import
#import <QuartzCore/QuartzCore.h>
[imageView.layer setBorderColor: [[UIColor blackColor] CGColor]];
[imageView.layer setBorderWidth: 2.0];
关于ios - 如何在 xcode 4.5 的 UIscrollview 中显示图像边框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15564451/