3

I want to test an iPhone app on the iPad, but I only have iPad now. IOS5.1 & Xcode 4.3.1 that are my environment and I set the same storyboard in the project TARGETS, the app runs on the iPad has been fullscreen displayed (all of the UILayouts have been stretched), cannot show any view switch in the app.

How can I run the same size app on the iPad?

j0k
  • 22,600
  • 28
  • 79
  • 90
koalago
  • 119
  • 10

2 Answers2

2

You need to change the app target from Universal to iPhone.

Go to [Project Targets] > Summary > iOS Application Target > Devices > iPhone

This way the iPad will open your app as a legacy iPhone app.

Colin
  • 115
  • 5
  • Posted the same answer as in the other question for completeness -- given this seems to be the same question as: http://stackoverflow.com/q/16010384/2281679 – Colin Apr 15 '13 at 08:59
  • Opps~ forgot to question it long time ago~~ – koalago Apr 15 '13 at 08:59
  • I think that's ok :) People might search differently and find either question + answer... – Colin Apr 15 '13 at 09:00
0

Not sure how to do this with storyboards but with normal UIViewControllers you would have seperate xib files for iphone/ipad and check which one to load like so:

  if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
        self.motionJpegViewController = [[MotionJpegViewController alloc] initWithNibName:@"MotionJpegViewController_iPhone" bundle:nil];
    } else {
        self.motionJpegViewController = [[MotionJpegViewController alloc] initWithNibName:@"MotionJpegViewController_iPad" bundle:nil];
    }
owen gerig
  • 6,165
  • 6
  • 52
  • 91
  • The separate xibs can really help run different UI on different devices, but I just want to use the same storyboard to run on the different devices. But thank you~~~~ – koalago Jun 06 '12 at 14:34
  • right but the xib files that storyboard uses have resolutions. those resolutions are going to be different (1024x768 vs 640×960) and thats why the stretching occurs. as far as i know there is no universal xib nor any way around this, except maybe not using a xib but i dont think thats what you want – owen gerig Jun 06 '12 at 14:35
  • Yes. maybe I really should use the xib – koalago Jun 06 '12 at 14:39
  • well storyboard does use xib in the background. heres some good links for you http://timroadley.com/2012/03/24/core-data-universal-ipad-storyboard/ and http://stackoverflow.com/questions/8465769/convert-storyboard-from-iphone-to-ipad – owen gerig Jun 06 '12 at 14:42