3

I have taken over the development and maintenance of a production iOS application being used mostly on the iPhone but also on the iPad. We found a specific UIButton that will respond as expected on the iPhone (device & simulator) but does not respond on the iPad (device & simulator).

I am lost on where to start debugging this item. Any suggestion? Thanks in advance.

JWD
  • 12,188
  • 3
  • 34
  • 32

2 Answers2

3

Kinda late to this party, but I had this symptom as well. The problem was my button was embedded in a view that had has height of 44 in IB, but when running shrunk to 0. It's contents rendered just fine, which made it hard to track down. Once I added a height constraint to the containing view, my UIButton now responds as expected. My guess is that the shorter height running on the iPad squished my containing view.

Rand
  • 165
  • 1
  • 1
  • 12
2

So it looks like this one was pretty easy for me.

[self.view bringSubviewToFront: button]; //moves the button above other subviews
[button setNeedsDisplay]; //ensure the button is redrawn

I am still not sure why this only happens when running on an iPad, but this fixed my problem.

JWD
  • 12,188
  • 3
  • 34
  • 32
  • not working in my case i have add button in xib of ipad and connected to the iboutlet and ibaction which is also connected to the xib of iphone and ibaction is touchdown and its working fine in iphone but not executing the ibaction of ipad. – Niranjan Balkrishna Prajapati Mar 15 '14 at 13:51
  • same here, but not working ! everything is fine on iphone, not only my button responding to touch, even its view is not being rendered as i am trying with color changing ! – dip Jun 30 '16 at 08:59