开发者

Start app in landscape mode only and lock the application in landscape mode

I am a new bie to stack over flow and iphone development ,I need to start my app in landscape mode only.for that i have set the keys in info.plist and write under the orientation delegete..but result remains same.I have done a tremendous research for that .but not yet successful..my xcode version is 3.2.26 and my basic template is tabbar based..Thank you so much if you are having some sincere suggestions regarding my problem

thank you

Priya (I开发者_如何学运维ndia)


You need to do this

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations;

return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight);

}


First of all define in your Info.plist file following key-value pair:

UIInterfaceOrientation UIInterfaceOrientationLandscapeLeft

or UIInterfaceOrientationLandscapeRight or to define initial start in Landscape right orientation afterward define shouldAutorotateToInterfaceOrientation in all your controllers in following way:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
  return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜