ImageView 以编程方式发送到后台
在尝试了上一篇文章中的所有方法后,我我无法成功将我的 ImageView 发送回我的示波器。我在我的示例中使用 Apple 示例的 aurioTouch 示例应用程序,我刚刚调整了其中的图像大小。现在我想在同一视图中显示另一张图像。在我的 applicationDidFinishLaunching
开头,我在写了
UIImageView *imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"myImage.png"]];
[imgView setFrame:CGRectMake(0,25,320,150)];
[view addSubview:imgView];
这么多代码之后编写了下面的代码,我尝试了上一篇文章中给出的所有方法,但无法在原始图像后面获取此 newssmage..
这里 < code>view 是从 UIView 继承的类之一。我如何将新图像发送回原始图像???
After trying all the methods in the previous post I am not able to succeed sending my ImageView back to my Oscilloscope. I am using aurioTouch sample of Apple's example in my app and I have just resized the image in that.. Now I want to have another image in the same view. In my applicationDidFinishLaunching
in the beginning I am writing the below code
UIImageView *imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"myImage.png"]];
[imgView setFrame:CGRectMake(0,25,320,150)];
[view addSubview:imgView];
after this much of code i tried all the methods that is given in previous post but not able to get this newssmage behind the original image..
Here view
is one of the class inherited from UIView.. How can I send new image back to my original image???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看一下
UIView
的文档,您就会看到一系列影响视图层次结构的可能方法。其中一些是:One look at the documentation for
UIView
would give you a list of possible methods to influence the view hierarchy. Some of them are:您需要
像这样在代码中调用视图对象
编辑:
我已经看到了代码,从它的外观来看,图像“Oscillscope.png”被添加到带有变量名称的EAGLView对象上
view
如果我是正确的,那么您也使用相同的变量来添加您的 imgView,所以我认为它应该可以工作。you need to call
on the view object in your code like this
EDIT:
I have seen the code and from the looks of it the the image "Oscilloscope.png" is added on the EAGLView object with variable name
view
and if I am correct the you are using the same variable to add your imgView too, so I think it should work.