UIButtons does not work on certain devices

I set the view and restrictions using the wAny hAny layout in Xcode 6:

enter image description here

When I launch the application on iPhone 5 and iPhone 6, the user interface elements are visible, but the answer and back buttons do not work on 5s - they do nothing.

On the iPhone 6, all buttons work.

Here is the code for the back button:

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

The answer code is a little longer, and I will not publish it if necessary.

Is this due to restrictions or should I look for answers elsewhere?

+6
source share
3 answers

Well,

I clicked the button "Allow automatic layouts" - "Reset to the proposed restrictions" (third from the left):

enter image description here

and that "solved" my problem. Everything works on all devices. It seems that I removed some of the restrictions that I set.

I need to learn more about why this worked.

+3
source

I had a similar problem. These were limitations that were a problem, and the fact that the button was not within the bounds of the view.

+1
source

I ran into this problem and the problem was with the button:

buttonView.frame.height = 0. (this can also happen with width)

The problem is that even without height, the button text appears on the screen, so if you do not have a background , the appearance of the button does not change .

To solve this problem, I played with the Content Compression Resistance (CCRP) views of different views to choose which view should change on the smaller screen.

The default CCRP by default is 750, the default priority is 1000. Thus, to meet your restriction, ios can resize your views

+1
source

Source: https://habr.com/ru/post/977366/


All Articles