【问题标题】:UIView add subview gapUIView 添加子视图间隙
【发布时间】:2013-04-19 03:23:37
【问题描述】:

我知道这可能是一个愚蠢的问题。但我正在 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];

【问题讨论】:

  • 你在使用 Interface Builder 吗?以及间隙是多少像素?
  • 我根本不使用 IB。差距是由于我使用的图像中的一些透明像素造成的。已经解决了。

标签: uiview uiimageview gaps-in-visuals


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多