标签:
UIImage *normal = [UIImage imageNamed:@"chatto_bg_normal"];// 这个是最终形状的图片。
UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 100, 100)]; //这个要被裁剪的view
UIImageView *imageViewMask = [[UIImageView alloc] initWithImage:normal];
imageViewMask.frame = CGRectInset(imageView.frame, 0.0f, 0.0f);
imageView.layer.mask = imageViewMask.layer;
[self.view addSubview:imageView];
将view剪切为各种形状的view(类似微信聊天图片展示)。
标签:
原文地址:http://www.cnblogs.com/xing-li/p/4481680.html