我要开发一个只有横向视图的程序..也就是说.无论手机旋转成什么样都是横向视图...
现在有问题,就是启动程序的时候,显示出来的是纵向,而且格式错乱得厉害.不知道怎么显示横向视图.
我想请教一下,怎么实现这个需求.我只需要横向显示我的应用.
或者告诉我调用哪个方法或者设置可以让程序一启动就是横向视图..
现在有问题,就是启动程序的时候,显示出来的是纵向,而且格式错乱得厉害.不知道怎么显示横向视图.
我想请教一下,怎么实现这个需求.我只需要横向显示我的应用.
或者告诉我调用哪个方法或者设置可以让程序一启动就是横向视图..
PS:csdn的管理员们听到你这么说会很伤心滴~我也把答案贴出来吧。
每个viewcontroller里面都用这个- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Overriden to allow any orientation.return UIInterfaceOrientationIsLandscape(interfaceOrientation);} 更详细更系统的描述,看这里。
http://developer.apple.com/library/ios/#documentation/General/Conceptual/iPadProgrammingGuide/CoreApplication/CoreApplication.html下面是复制楼上的答案。
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
orUIInterfaceOrientationLandscapeRight