UIView 添加子视图间隙



我知道这可能是一个愚蠢的问题。但我正在 xcode 3 中设计一个单视图应用程序,ios 5。以编程方式添加子视图和图像视图以占据整个屏幕。但它在屏幕上显示我在视图底部的一个小间隙。不知道为什么。这是代码。有什么建议吗?

[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
homeView =[[UIView alloc] initWithFrame:self.view.frame];
UIImageView *backImage= [[UIImageView alloc] initWithFrame:self.view.frame];
backImage.image=[UIImage imageNamed:@"bg.png"];
[homeView addSubview:backImage];
[self.view addSubview:homeView];

间隙是由于我使用的图像中的一些透明像素造成的。代码没有任何问题。它已解决。谢谢

最新更新