资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

ios单个ViewController屏幕旋转-创新互联

如果需要旋转的ViewController 使用了UINavigationController,对UINavigationController进行如下扩展ios单个ViewControl
ler屏幕旋转
@implementation UINavigationController(shouldAutorotate)
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); }
- (BOOL)shouldAutorotate { return self.topViewController.shouldAutorotate; }
- (NSUInteger)supportedInterfaceOrientations { return self.topViewController.supportedInterfaceOrientations; } @end

需要旋转的ViewController设置

在新区等地区,都构建了全面的区域性战略布局,加强发展的系统性、市场前瞻性、产品创新能力,以专注、极致的服务理念,为客户提供成都网站设计、成都网站建设 网站设计制作专业公司,公司网站建设,企业网站建设,成都品牌网站建设,成都全网营销推广,外贸网站建设,新区网站建设费用合理。
 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
return YES;
}

- (BOOL)shouldAutorotate
{
return YES;
}

- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAll;
}

其他不需要旋转的 ViewController设置,建议添加BaseViewController统一控制

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
- (BOOL)shouldAutorotate
{
return NO;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationPortrait;
}

网页名称:ios单个ViewController屏幕旋转-创新互联
网站路径:http://www.cdkjz.cn/article/dhdcoc.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220