开发者

iPhone - Landscape Only App

I am trying to make an app that will only be viewed in Landscape. I have looked up some tutorials (albeit older ones) and have done the following:

-set up the info.plist to include a key for uiinterfaceorientation

-in the main view controller I have set the frame to be 480 x 320

Now, the first screen loads up ok. Everything is where it should be and whatnot. However, if I click a button that is set to present a modal view controller nothing happens. Everything is linked and coded correctly but nothing happens when I press the button. Am I doing something wrong with trying to force landscape?

At it's basic, this question is a how do you effectively make an app that will only be in lands开发者_JAVA百科cape mode? Thanks for any help.


You should only uncomment this method I show you below:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
  // Return YES for supported orientations
  return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜