国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 開發(fā)設(shè)計(jì) > 正文

ios單個(gè)ViewController屏幕旋轉(zhuǎn)

2019-11-14 20:38:30
字體:
供稿:網(wǎng)友

如果需要旋轉(zhuǎn)的ViewController 使用了UINavigationController,對(duì)UINavigationController進(jìn)行如下擴(kuò)展

@implementation UINavigationController(shouldAutorotate)
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{ return (interfaceOrientation == UIInterfaceOrientationPortrait);}
- (BOOL)shouldAutorotate{ return self.topViewController.shouldAutorotate;}
- (NSUInteger)supportedInterfaceOrientations{ return self.topViewController.supportedInterfaceOrientations;}@end

需要旋轉(zhuǎn)的ViewController設(shè)置

 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{    return YES;}- (BOOL)shouldAutorotate{    return YES;}- (NSUInteger)supportedInterfaceOrientations{    return UIInterfaceOrientationMaskAll;}

 

其他不需要旋轉(zhuǎn)的 ViewController設(shè)置,建議添加BaseViewController統(tǒng)一控制

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

 


發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 鸡泽县| 胶州市| 马山县| 甘南县| 石台县| 宣武区| 杂多县| 浮梁县| 五台县| 嘉定区| 古浪县| 丹阳市| 册亨县| 瓦房店市| 江西省| 如皋市| 东阳市| 梁山县| 东安县| 桂林市| 凤台县| 怀柔区| 凤冈县| 丰台区| 津市市| 颍上县| 定边县| 潜江市| 和龙市| 门源| 长沙市| 商南县| 军事| 塔河县| 华蓥市| 兴仁县| 岳阳市| 庄河市| 文安县| 沾益县| 鸡西市|