- Home /
New UI buttons not working on top of screen on iOS devices.
I use many canvas (buttons, texts etc.) objects in my project. All of them works fine in editor and android devices. However, some of them don't work in iOS devices. These buttons (not working) are located on the top of the screen. When I drag them to slightly down, they work. It is so strange, they don't work up to a point but works down from that points. Please look at the image attached. I draw a red line. When I pressed the points above that line, there is no response. When I pressed the points below that line everything works.
I use unity 4.6.0 and 4.6.1 for test this problem. Also, I use iOS 8.1. The used devices are iPhone 5C and İpad
I'm having a very similar problem but I`m not using Google$$anonymous$$obileAds, I`m using Cardboard and have a UI overlay, the buttons work fine on Android but not in iOS. Also on the editor I found what you said about moving the button to the center of the screen it works, but also if I scale the button down it has kindda an invisible "interactable area" that changes when I scale the button. The weird thing is why this works bad only on iOS???
Answer by uboncukcu · Jan 30, 2015 at 10:26 AM
I found the problem. GoogleMobileAds cause that problem. Even, it doesn't show any banner image, it obstructs clicks under it !!!
Glad you found it and thumbs up for posting the solution.
Answer by Mmmpies · Jan 28, 2015 at 04:58 PM
Man we're gonna struggle with the word top in this one.
The new ui orders things with the top items im the hierarchy being furthest back. So the lowest items are, ironically, the top items on the screen. Seen it quite a few times that a slight change in aspect ratio or resolution moves a panel over the button.
Try moving the button to the bottom of the hierarchy and therefore the top of the screen or the front of the screen is a better way of putting it.
EDIT:
Well it can't be the event system not being there as the buttons work if moved and presumably other buttons work just fine, which is why I thought it's likely to be the order. Is the canvas the buttons are on the lowest canvas in the hierarchy as well?
EDIT 2:
Scratching my head now. Can you create an empty project just put a canvas and a button on where it'll appear in the same place as your broken buttons and just Debug.log to prove your device works.
EDIT 3:
Interesting, you OK doing a raycast? If you are create a text object lower down the screen and do a raycast that sets the text to whatever it hits
myText.text = hit.collider.gameObject.name;
That way you can see what it hits when on your phone. Not tested that code though.
Thanks man. I have built it as you said but nothing changed. I moved the buttons, with problem, to the bottom of the hierarchy. Any more help?
I have only one canvas in my project. However, I was created new canvas just to try. I used it as lowest canvas and bring my problematic button in it. Still same problem!!
I converted the canvas to prefab and then, I export it as unity package. I used it in empty unity project. Those buttons (not working buttons in old project ) work fine. There are just problem with small buttons. I could not found any differences between two projects!
Your answer
Follow this Question
Related Questions
UI Button onclick not detected 0 Answers
First selected GameObject not highlighted 3 Answers
UI elements stop working based on hirarchy position 1 Answer
Unusual trouble with OnPointerClick 1 Answer
Only a button can work 1 Answer