UIView添加了子视图差距

时间:2012-05-25 19:03:32

标签: uiview uiimageview gaps-in-visuals

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

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

1 个答案:

答案 0 :(得分:0)

差距是由于我正在使用的图像中的一些透明像素。代码没有错。它已经解决了。 感谢

相关问题