目前我工作的拼贴应用程序。我想绘制拼贴画框,然后我需要从相机胶卷或相机中添加图像。我需要以下类型视图 如何添加具有不同形状的多个imageView?
我已经添加了5个UIImageViews。要绘制的形状我已经加入UIBezierPath像imageview1
UIBezierPath *path1 = [[UIBezierPath alloc] init];
[path1 moveToPoint:CGPointMake(0, 0)];
[path1 addLineToPoint:CGPointMake(150, 0)];
[path1 addLineToPoint:CGPointMake(0, 150)];
[path1 addLineToPoint:CGPointMake(0, 0)];
UIImageView *imgView1 = [[UIImageView alloc] initWithFrame:CGRectMake(140, 0, 160, 300)];
imgView1 . tag = 2;
imgView1 . userInteractionEnabled = YES;
imgView1. backgroundColor = [UIColor greenColor];
CGPathRef borderPathRef2 = [path1 CGPath];
CAShapeLayer *borderShapeLayer2 = [[CAShapeLayer alloc] init];
[borderShapeLayer2 setPath:borderPathRef2];
[[imgView1 layer] setMask:borderShapeLayer2];
imgView1.layer.masksToBounds = YES;
[borderShapeLayer2 release];
[view1 addSubview:imgView1];
喜欢我所做的所有5.但是,增加imageView5触摸后,因为它的框架上其他四个ImageView的overlaping是不是对所有其他4次检测。
所以我没有得到如何设计这一点。我需要通过触摸操作将图像添加到所有图像。
请帮帮我。如果有人对此有任何想法,请分享。
在此先感谢。
以下是实施例2这是从的Insta拼贴应用。
为什么不使用button.You有背景图片以及动作? – 2013-02-26 12:09:02
如果我将使用按钮则只有imageview5会做按钮操作。 – deepti 2013-02-26 12:13:41
可以请你分享,你要实现的具体形象设计?这个框架显示了实现相同的几个选择。对于特定于您的需求,发布链接 – 2013-02-26 12:13:50