iphone - 使用 CGRect 显示的图像遮盖了 UIButtons

标签 iphone uiimageview uiimage

我有一个使用 CGRect 显示的图像(代码如下)。问题是它模糊了 nib 文件中的 UIButtons。

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];

如果我将 CGRect 变小,UIButton 就在那里。 我不知道如何解决这个问题,非常感谢任何帮助。

谢谢

最佳答案

您需要将 subview 发送到后面:

[self.view sendSubviewToBack:myImage];

关于iphone - 使用 CGRect 显示的图像遮盖了 UIButtons,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3622800/

相关文章:

iphone - uiimage 未正确放入 subview 中

ios - 定义 UIImage 将使用的文件 (Swift)

ios - 使用图像作为 UIViewController 的背景并支持多种屏幕尺寸

iphone - 在导航 Controller 上显示工具栏按钮

iphone - UIScrollView 在内部动画时回调

iphone - GPUImageStillCamera 输出图像分辨率

ios - 什么时候在 iOS 中检索图像高度是安全的

ios - 在上下文上绘图时在 UIImage 上应用 CATransform3D

iphone - 让用户在 iOS 应用程序中裁剪照片

ios - 如何快速更改工具栏中的条形按钮图标?