ios开发点滴

来源:互联网 发布:js 判断字符串长度 编辑:程序博客网 时间:2024/05/17 09:08

// Override to allow orientations other than the default portrait orientation.

// This method is deprecated on ios6

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {

    returnUIInterfaceOrientationIsLandscape( interfaceOrientation );

}

虽然6.0已经不用了,但是如果对于老版本的6.0以下的还是需要的。


// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead

- (NSUInteger) supportedInterfaceOrientations{

#ifdef __IPHONE_6_0

    returnUIInterfaceOrientationMaskLandscape;

#endif

}


- (BOOL) shouldAutorotate {

    return YES;

}

原创粉丝点击