【问题标题】:Getting zero width and height of view?获得零宽度和高度的视图?
【发布时间】:2012-07-26 07:02:24
【问题描述】:

我有一个主视图,在里面我拖放了另一个名为 firstview 的视图。

我的视图宽度和高度为零,如下例所示。

NSLog(@"  WIDTH =%d",firstview.frame.size.width);
NSLog(@"  HEIGHT =%d",firstview.frame.size.height);

可能是什么原因?

【问题讨论】:

  • 你连接firstview的IBoutlet了吗?

标签: iphone xcode ipad ipod


【解决方案1】:

我同意@waheeda,我猜你没有连接firstview的IBOutlet。

【讨论】:

    【解决方案2】:

    你已经拖放了另一个视图..所以界面生成器中可能存在视图连接问题

    【讨论】:

    • 我已经连接到 Interface Builder,虽然遇到了问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-12-08
    • 1970-01-01
    • 1970-01-01
    • 2011-11-26
    • 2015-08-16
    • 1970-01-01
    • 2021-05-09
    相关资源
    最近更新 更多