When I load a new view in Cocoa Touch, it shifts everything by about 20 pixels

enter image description here

Well, since in this picture progression I have a home screen with a β€œSongs” button on it. When this is clicked, it loads the new Nib and .h and .m files, as shown in the middle image. Then the back button returns us to the main menu.

The problem is that when I load this new view, it shifts everything to 20 pixels (around how many status bars). Does anyone know why this is so. Let me know. I can also provide code.

+3
source share
3 answers

. , , - , , . :

CGRect fullFrame = [[UIScreen mainScreen] applicationFrame];
self.view.frame  = fullFrame;
+3

, , wantsFullScreenLayout YES. UIViewController s.

+2

You will probably add the view to the frame window (0,0, 320,460). So add 20 pixels to the y coordinate. It is better to choose a UIViewController instead.

+1
source

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


All Articles