2014-08-28 85 views
0

我在我的iPhone应用程序中使用UICollectionView,我已经修改了循环方式的horizinatcl旋转的uicollection视图。以下是图片。 enter image description hereUiimageview边框是用锯齿形边框变形的吗?

现在我所面临的问题是为什么这个图像的边界与zigzaging边界distroted。 我不知道这是为什么,为什么。任何人都知道我该如何解决这个图像边界的distrotation。

任何帮助将是可观的..

回答

0

这里创造的形象和ImageView的,添加边框的代码和圆形的角落:

// Define a new image object 
    UIImage *image = [UIImage imageNamed:@"lake.png"]; 

// Define a new image view 
    UIImageView* imgView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 157, 125)]; 

// Set image in imageview and add to view 
    [imgView setImage:image]; 
    [[self view] addSubview:imgView]; 

// Create a white border with defined width 
    imgView.layer.borderColor = [UIColor whiteColor].CGColor; 
    imgView.layer.borderWidth = 1.5; 

// Set image corner radius 
    imgView.layer.cornerRadius = 5.0; 

// To enable corners to be "clipped" 
    [imgView setClipsToBounds:YES]; 

希望这可以帮助你。

+0

不可以..不能正常工作 – 2014-08-28 14:43:02

0

尝试这样的事情与你的形象

UIImage *image = [[UIImage imageNamed:[self.imgArray objectAtIndex:indexPath.row]] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10)]; 

如果需要,改变UIEdgeInsets值...

+0

不可以..不能正常工作 – 2014-08-28 14:42:23