It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center




7年前关闭。




我需要在一个视图中显示两个图像。到现在为止,我只完成了一个图像的显示,但是如何在一个视图中显示两个图像呢? iPhone可能吗?如果可以,请您指导我如何操作?

注意:我需要同时显示两个图像。

最佳答案

UIImageView *imgView1 = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 100, 50)];
UIImageView *imgView2 = [[UIImageView alloc] initWithFrame:CGRectMake(110, 110, 100, 50)];
imgView1.image = [UIImage imageNamed:@"image1.png"];
imgView2.image = [UIImage imageNamed:@"image2.png"];
[self.view addSubview:imgView1];
[self.view addSubview:imgView2];

关于iphone - 如何在单个 View 中显示两个图像-iPhone,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14683600/

10-10 05:47