【问题标题】:iPhone showing Different to the SimulatoriPhone 显示与模拟器不同
【发布时间】:2012-05-27 07:06:45
【问题描述】:

.

你好,

首先,这个问题可能与我的上一个问题相似,但事实并非如此。供参考,如果你必须比较它在这里Previous Question

现在我开发了一个应用程序,它可以在 iPhone 模拟器上完美运行。它不使用模拟器无法处理的任何东西。

我有一个按钮,在代码中生成,它出现在我的模拟器中的 mac 上,但没有出现在 2 台测试设备上。 1) iPhone4 和 2) 第 4 代 iPod Touch。

这怎么可能?

-(void)popUpMenu
{
UIImage *image = [UIImage imageNamed:@"Menu01@2x.png"];
UIImage *selectedImage = [UIImage imageNamed:@"Menu02@2x.png"];
UIImage *toggledImage = [UIImage imageNamed:@"Done01@2x.png"];
UIImage *toggledSelectedImage = [UIImage imageNamed:@"Done02@2x.png"];

NSArray *buttons = [NSArray arrayWithObjects:b1, b2, b3, b4, b5, nil];

RNExpandingButtonBar *bar = [[RNExpandingButtonBar alloc] initWithImage:image selectedImage:selectedImage toggledImage:toggledImage toggledSelectedImage:toggledSelectedImage buttons:buttons center:center];

//    RNExpandingButtonBar *bar = [[UIButton buttonWithType:UIButtonTypeRoundedRect] initWithArray:buttons];


[bar setHorizontal:NO];
[bar setExplode:NO];
[self.view addSubview:bar];
[self setBar:bar];
}

数组是一组由此出现的按钮。 Github 的链接是: Github - RNExpandingButtonBar

然后我在 viewDidLoad 方法中使用这段代码来显示按钮

[self popUpMenu];

杰夫干杯

【问题讨论】:

  • 请添加“生成”按钮的代码
  • 添加了代码 - 它是一个图像生成按钮,我之前已经生成了这些,所以我不确定这个。奇怪的是模拟器完全没有问题。
  • 检查代码和工作区中图像名称的大小写,设备区分大小写。可能是你的问题
  • 如果你在非视网膜版本有相同的图像,你不需要附加@2x 后缀。此外请注意文件名,设备区分大小写。
  • 谢谢 iTukker - 就是这样 - 如果您将其作为答案发布,我可以接受并给您更多积分:-)

标签: iphone ios ios-simulator


【解决方案1】:

检查代码和工作区中图像名称的大小写,设备区分大小写,而 OSX 默认不区分大小写。这就是为什么它可以在您的模拟器中运行,而不是在您的设备上运行。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-05-12
    • 2012-01-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-22
    • 2015-04-21
    • 1970-01-01
    相关资源
    最近更新 更多