【发布时间】:2013-03-22 06:52:41
【问题描述】:
我有一个滚动视图,其中正在使用 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);
任何人都可以给我一些解释的建议,以便将来也有帮助..
【问题讨论】:
-
你想给imageview添加边框吗?
-
是的,我想给 UIImageView 添加边框
-
那么 Rajan 的回答就可以了
标签: ios xcode uiimageview xcode4.5 css