对于刚接触ipad/iPhone编程的人来说,控制其显示方向是挺纠结的!下面我来给大家详细讲讲这应该是如何控制的。
相信很多人都是,我要控制其横向显示不是很简单,直接在代码里的
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
函数里控制其显示方向不就行了?并且网上也有很多这方面的教程也是这么说的!
那好,那么我们新建一个工程,在其AppDelegate.m里添加下面的代码
控制横向【在网上搜索,相信大家都能得到如何代码控制其横向显示效果的代码】
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if(interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation