【发布时间】: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