Tuesday, October 20, 2026
HomeiOS Developmentios - UI Button picture disappears when “debug executable” is unchecked in...

ios – UI Button picture disappears when “debug executable” is unchecked in edit scheme

[ad_1]

I’ve created a UIButton in storyboard, and have set a picture for the UIButton (the picture is in property.xcassets). The button reveals up within the simulator and when run on an iPhone. Nevertheless, if I give up the app on the iPhone and open it once more, the button disappears, however I’m nonetheless in a position to click on it and it really works. The identical factor occurs once I uncheck “debug executable.” After I verify the view hierarchy, the button is on prime of the hierarchy however is invisible. Utilizing infoButton.isHidden = false additionally doesn’t work. In my button’s view controller, I’ve known as view.bringSubviewToFront(_: infoButton) in viewDidLoad().

I’ve additionally tried setting the button’s picture programmatically, however it nonetheless does not present up. Nevertheless, once I set a background coloration for the button with infoButton.backgroundColor = UIColor.blue, I can see a blue field the place the button must be, however no picture. Listed here are my settings
(half 1,half 2) for the UIButton.

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments