UIImageView图像没有显示出来

Hig*_*asy 0 uiimageview uiimage ios

_topBar = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 320, 45)];

UIImageView *bar = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"top_bar.png"]];
bar.frame = CGRectMake(0, 0, 320, 45);
[_topBar addSubview:bar];

_up = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"up.png"]];
[_topBar addSubview:_up];
Run Code Online (Sandbox Code Playgroud)

_up没有显示在我的构建中.如果我为我的资源文件夹中的任何其他图像交换"up.png",它会显示,但up.png拒绝.有什么我能做的吗?我只使用UIImage,静态分配的UIImageView初始化它,删除并重新添加.png文件,将它们从资源文件夹中取出并放在其他地方,重新保存它们,除了抛出它们之外的所有内容.

编辑: 该文件保存为up.png但真的是up.png.psd.只是阅读细则的问题.

Rya*_*los 6

检查Finder中的种类.它可能不是一个png,因此不会显示.

我现在知道这是真的,因为你评论:)