LoginSignup
7
5

More than 5 years have passed since last update.

セットした画像が表示されないとき

Posted at

xcodeのImages.xcassetsにセットした画像で読み込めないものがあった。

Images.xcassets上では表示できている。
ビュー側はxibで実装していたが、xib上でも表示されているし、Referenching Outletの設定も正常に出来ている。
試しにプログラム上で、

UIImage *image = [UIImage imageNamed:@"Sample.png"];
[self.view addSubview:image];

とか

UIImage *image = [UIImage imageNamed:@"Sample"];
[self.view addSubview:image];
[self.view bringSubviewToFront:image];  //最前面にする処理

と書いても、画像が表示されなかった。

下記サイトを参考にして、解決した。
http://kyo-asu-aozora.seesaa.net/article/257890808.html

7
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
5