iPhone 显示与模拟器不同

标签 iphone ios ios-simulator

.

你好,

首先,这个问题可能看起来与我的上一个问题相似,但事实并非如此。如果您必须比较它,请引用此处 Previous Question

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

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

这怎么可能?

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

干杯杰夫

最佳答案

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

关于iPhone 显示与模拟器不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10772252/

相关文章:

iphone - iPhone 上全屏视频格式的正确尺寸是多少

iphone - 三个整数比较

iphone - 适用于 Mac/iPhone 的 xUnit 测试框架

ios - 为什么将键盘类型 "decimal pad "从应用程序更改为另一个?

ios - 为什么我不能用字符串下标 Dictionary<String, Int>?

ios-simulator - iOS 模拟器拒绝连接到本地。主机名

ios - 在 XCode 的一个目标中有两个 GoogleService-Info.plist

如果应用程序以 iPhone 横向启动,iOS 13 应用程序窗口会在 iPhone 上错误地旋转

opengl-es - 有人为 iPad 模拟器修复了 GLImageProcessing 示例吗?

ios - 无法在模拟器 "The operation couldn’ 上运行应用程序无法完成。 (LaunchServicesError 错误 0。)”