开发者

Image displayed using CGRect is obscuring UIButtons

I ha开发者_如何学Cve an image displayed using CGRect (code below). the problem is that it's obscuring UIButtons I have in the nib file.

CGRect myImageRect = CGRectMake(0.0f, 40.0f, 480.0f, 280.0f);
UIImageView *myImage = [[UIImageView alloc] initWithFrame:myImageRect];
[myImage setImage:[UIImage imageNamed:recipe.image]];
[self.view addSubview:myImage];
[myImage release];

if I make the CGRect smaller, the UIButtons are there. I can't figure out how to fix this, any help is very appreciated.

thanks


You need to send your subview to the back:

[self.view sendSubviewToBack:myImage];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜