ios - 如何在 xcode 4.5 的 UIscrollview 中显示图像边框?

标签 ios xcode uiimageview xcode4.5 css

<分区>

我有一个 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/

上一篇:css - 仅使用 CSS 以网格格式对 div 进行排序

下一篇:css - 如何在 Opera 中禁用 css 动画关键帧?

相关文章:

ios - 有没有办法将pdf文件嵌入到html5页面中?

ios - Xcode 8 应用程序在模拟器上运行但不显示

ios - 个人帐户开发者之间的 Apple 开发/分发证书

ios - UIImageview 在获取图像后不会在静态 TableView 单元格中保留其圆形

ios - Facebook 全屏图片

ios - 为什么我的自由格式 ModalViewController 总是显示全尺寸?

ios - 从 objective-c 文件访问swift文件中的共享数据

ios - UIView 中的 Swift UILabel

ios - 无法使用 SWIFT 2 从附件标签 rss xml 中提取 url 值

objective-c - 从 UIImageViews iOS 创建 png