首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >iPhone上的SImulator -设备问题-图像显示方式不同

iPhone上的SImulator -设备问题-图像显示方式不同
EN

Stack Overflow用户
提问于 2009-11-26 06:49:54
回答 1查看 386关注 0票数 0

我在显示图像时遇到问题...它在模拟器上工作得很好,但在iphone设备上却不起作用。这是它的代码。

请帮帮忙-

代码语言:javascript
复制
UIView *shareView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 95)];
    shareView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"bgImage.png"]];


    UIButton *button1 = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 64, 95)];
    UIImage *icon1 = [UIImage imageNamed:@"icon1.png"];
    [button1 setImage:icon1 forState:UIControlStateNormal];
    [button1 addTarget:self action:@selector(sendEmail) forControlEvents:UIControlEventTouchDown];
    [shareView addSubview:button1];

    UIButton *button2 = [[UIButton alloc] initWithFrame:CGRectMake(64, 0, 64, 95)];
    UIImage *icon2 = [UIImage imageNamed:@"icon2.png"];
    [button2 setImage:icon2 forState:UIControlStateNormal];
    [shareView addSubview:button2];

    UIButton *button3 = [[UIButton alloc] initWithFrame:CGRectMake(128, 0, 64, 95)];
    UIImage *icon3 = [UIImage imageNamed:@"icon3.png"];
    [button3 setImage:icon3 forState:UIControlStateNormal];
    [shareView addSubview:button3];

    UIButton *button4 = [[UIButton alloc] initWithFrame:CGRectMake(192, 0, 64, 95)];
    UIImage *icon4 = [UIImage imageNamed:@"icon4.png"];
    [button4 setImage:icon4 forState:UIControlStateNormal];
    [shareView addSubview:button4];

    UIButton *button5 = [[UIButton alloc] initWithFrame:CGRectMake(256, 0, 64, 95)];
    UIImage *icon5 = [UIImage imageNamed:@"icon5.png"];
    [button5 setImage:icon5 forState:UIControlStateNormal];
    [shareView addSubview:button5];


    [shareCell.contentView addSubview:shareView];
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2009-12-23 22:29:05

你通过iTunes安装在iphone设备上的.app文件夹包含了所有的图片吗?在我的应用程序中,我遇到了同样的问题,因为我想要显示的图像不在.app文件夹中。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/1800497

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档