Xcode 6: images are not displayed on the device

I create a UIImageView and add these views to the UIScrollView. Images appear when I test the simulator, but when I test on iphone 5s, the images are not displayed. The following is a list of the things I tried:

  • Clear assembly

  • Reinstall application

  • Then I thought it was a problem with retinal images, so I added retinal images (images are white png): enter image description here

    • I use images as such:

      UIButton * doneBttn = [UIButtonWithType button: UIButtonTypeCustom]; [doneBttn setImage: [UIImage imageNamed: @ "addButton.png"] forState: UIControlStateNormal]; [doneBttn setImage: [UIImage imageNamed: @ "addButtonSelected.png"] forState: UIControlStateHighlighted]; [doneBttn setFrame: CGRectMake (0, 0, 50, 30)]; [doneBttn addTarget: self action: @selector (firing) for ControlEvents: UIControlEventTouchUpInside]; [uiNavView addMenuBarButtonRight: doneBttn];

    • I know that the code above works because the image is displayed in the simulator.

What do I need to change to display the image on my device? In addition, I checked that the files were in the xcode project directory, and not just linked.

+4
1

, , , UIImageView, , UIImageView , .

, , ,.png,.jpg, , , .

+4

Source: https://habr.com/ru/post/1543156/


All Articles