Search code examples
iphoneiosxcodeipadlandscape

Xcode 4.5.2: How to correctly program a CGRectMake?


I want a view, which is in LANDSCAPE mode, to move up when a textField is being edited (because it is covered by the keyboard), the problem is that I'm not setting correctly the coordinates because the view moves to the left instead of going up, it seems as X values were changed by Y values and voiceovers. What am I doing wrong? How can I get it solved? Is there any special code for LANDSCAPE mode?

CODE:

self.view.frame = CGRectMake(0, -160, 300, 480);

Thanks a lot!!


Solution

  • Often the most tedious mistakes are the ones we never look for. :P

    self.view.frame = CGRectMake(0, -160, 480, 300);