Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIButtons not working on certain devices

I've set up a view and constraints using the wAny hAny layout in Xcode 6:

enter image description here

When I run the app on a iPhone 5s and iPhone 6 the UI Elements are all visible but on the 5s the answer and the back buttons do not work - they do nothing.

On the iPhone 6 all the buttons work.

Here's the code for the `back' button:

- (IBAction)backFromDivision:(id)sender {
[self dismissViewControllerAnimated:YES completion:nil];
}

The answer code is a bit longer and I won't post it unless necessary.

Does this have something to do with the constraints or should I be looking for answers elsewhere?

like image 717
MayNotBe Avatar asked Oct 28 '14 17:10

MayNotBe


2 Answers

Well,

I clicked on "Resolve Auto Layout Issues" - "Reset to suggested constraints" (third from the left):

enter image description here

and that "solved" my problem. Everything is working on all devices. It seems to have removed some constraints that I put in place.

I'm going to have to learn more about why this worked.

like image 86
MayNotBe Avatar answered Sep 30 '22 00:09

MayNotBe


I've had a similar issue before. It was the constraints that were the issue and the fact that the button was not in the view's bounds.

like image 26
Robert J. Clegg Avatar answered Sep 30 '22 00:09

Robert J. Clegg