2vi*_*on2 2 iphone objective-c uiimageview uiimage ios
我需要在一个视图中显示两个图像.到目前为止我只显示了一个图像,但如何在一个视图中显示两个图像?在iPhone中有可能吗?如果是这样,请指导我如何?
注意:我需要同时显示两个图像.
如果要重叠2张图像,请粘贴此代码,
UIImage *a = [ your 1st iamge];
UIImage *b = [ your 2nd iamge];
UIGraphicsBeginImageContext(a.size);
[a drawInRect:CGRectMake(0, 0, a.size.width, a.size.height)];
[b drawInRect:CGRectMake(a.size.width - b.size.width, a.size.height - b.size.height, b.size.width, b.size.height)];
UIImage *result = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
[YourImageView setImage:result];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2566 次 |
| 最近记录: |