UIImageView在故事板中显示,但不会显示在模拟器中 [英] UIImageView shows in storyboard but doesn't show up in simulator

查看:82
本文介绍了UIImageView在故事板中显示,但不会显示在模拟器中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在故事板中使用uiimageview添加了图像,并将它们连接到iboutlet,它们没有出现在模拟器中。我认为它们不在屏幕之外,因为它们非常接近其他图像,我自动布局关闭,因为我在其他线程中看到这可能是一个问题。这是一些代码,如果它可能会有所帮助。没有人会出现在模拟器中。

I added images using uiimageview in storyboard and connected them to iboutlets and they are not showing up in the simulator. I don't think they are off screen since they are very close to other images and I have auto layout off as i saw in other threads that may be a problem. This is some code if it may help. None of the hearts will show up in simulator.

编辑:我刚将其中一张图片移动到屏幕中央,当我清理/构建/运行时在模拟器中改变了。因此,出于某种原因,我在故事板中改变的任何内容都没有被转移到模拟器中。这一切都在昨晚奏效,我不确定今天下午会发生什么变化。

I just moved one of the other images to the center of the screen and when I clean/build/run nothing changed in the simulator. So for some reason anything I change in storyboard is not being carried over into simulator. It all worked last night and I'm not sure what could have change to this afternoon.

#import <UIKit/UIKit.h>

float LeftMovement;
float RightMovement;
float UpMovement;
int life = 3;

@interface Game : UIViewController
{
    IBOutlet UIButton *Start;
    IBOutlet UIImageView *Runner;
    IBOutlet UIImageView *Water;
    IBOutlet UIImageView *Heart1;
    IBOutlet UIImageView *Heart2;
    IBOutlet UIImageView *Heart3;
    IBOutlet UILabel *Lives;

    NSTimer *Movement;


}

-(IBAction)StartGame:(id)sender;
-(void)Moving;
-(void)Walk;
@end


推荐答案

我来晚了但是正确的答案是

i came up late but the right answer is

右键单击Xco​​de中的图像,转到文件检查器,我必须选中目标会员下的复选框

Right click on the image in Xcode, go to File Inspector, i had to check the checkbox under "Target Membership"

这篇关于UIImageView在故事板中显示,但不会显示在模拟器中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆