(iOS) UIButton is greyed out when hidden over UIImageView

I do exactly the following in sequence:

  1. I create a new iOS project with Objective C in XCODE 10.1
  2. I have 1 UIImageView with a default image
  3. I then add 1 UIButton (called testbutton) where it overlays the imageview
  4. When I click the UIButton it successfully goes to a method where I perform:

testbutton.hidden = TRUE;


When the method is called successfully I use the debugger to make sure this line is called as well.


The UIButton called testbutton label goes from BLACK to a GREY so it is truly not hidden.


This seems too simple....


How do I hide the UIButton when it is over the UIImageView?

Accepted Reply

I tested exactly this (in Swift) and it works flawlessly.


What happens when you move the button outside of image ?

Replies

I tested exactly this (in Swift) and it works flawlessly.


What happens when you move the button outside of image ?

The behavior is the same if the button is on the UIImageView or not on it.


Update:

I am reporting this as behavior in my Xcode Simulator (tested 5S, 6 and XR). I made Xcode install it on my actual device (iPhone 5S) and it worked flawlessly. As I write this message I am running the simulator again with it displaying beside the browser. After a couple of minutes the button actually goes from GREY to disappearing. This must be a bug in the Xcode simulator because I am running no other applications other than Xcode and Safari and my machine has plenty of RAM (see below for my specs).


I am running MacOS High Sierra Version 10.13.16 (17G4015) with Xcode Version 10.1 (10B61)

on a MacBook Pro 13-inch Late 2011 machine with 16GB or RAM


Thank you for checking on this! I thought I was going crazy.


How can I log this as a bug with Apple?

>log this as a bug


Feel free to utilize the Report Bugs link, below right, every page here, being sure to add you report # to your thread for reference, thanks and good luck.