【问题标题】:How to save two imageviews in one imageview in iPhone [duplicate]如何在iPhone的一个图像视图中保存两个图像视图[重复]
【发布时间】:2014-03-20 11:33:00
【问题描述】:

在我的应用程序中,我有两个具有不同图像的不同图像视图。我的第二个图像视图小于第一个图像视图。用户可以使用 UITouch 事件更改第二个图像的位置。现在,我想将这两个图像保存为具有更改位置的单个图像.这是我更改图像位置的代码:

-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [[event allTouches] anyObject];
CGPoint location = [touch locationInView:touch.view];
cloud.center = location;
}

-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
[self touchesBegan:touches withEvent:event];

它工作正常但是,如何将两个图像视图合并到一个图像视图中?请帮助我。提前致谢。

【问题讨论】:

标签: ios iphone objective-c uiimageview


【解决方案1】:

制作第三个 UIImageView 然后使用

[thirUIVIew addSubview: firstUIView]; [thirUIVIew addSubview: secondUIView];

您可以交换这两个语句的顺序,并得到另一个。

如果你这样做,你可以像使用第三个 uiview 一样,但以后如果你需要你可以 获取thirdView的子视图。

对不起我的英语:)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-08
    • 1970-01-01
    • 2011-03-04
    • 1970-01-01
    • 1970-01-01
    • 2023-03-10
    相关资源
    最近更新 更多