第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

在iOS6中,將ViewController推入堆棧時(shí)強(qiáng)制將ViewController強(qiáng)制為特定

在iOS6中,將ViewController推入堆棧時(shí)強(qiáng)制將ViewController強(qiáng)制為特定

iOS
至尊寶的傳說(shuō) 2019-11-20 10:04:31
我設(shè)置了以下視圖控制器:viewController1可以自由旋轉(zhuǎn)到除了人像倒置之外的任何方向。viewController2被推到viewController1的頂部,我希望它與viewController1的方向相同,并且我希望它不能旋轉(zhuǎn)。viewController3被推到viewController2的頂部。我希望viewController3處于縱向模式。我在嘗試在iOS6中完成此操作時(shí)遇到了很多問(wèn)題(在iOS5中尚未嘗試過(guò))。首先,我已經(jīng)創(chuàng)建了自己的導(dǎo)航控制器,并將以下內(nèi)容放入其中:- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{    return [self.topViewController preferredInterfaceOrientationForPresentation];}- (NSUInteger)supportedInterfaceOrientations{    return [self.topViewController supportedInterfaceOrientations];}- (BOOL) shouldAutorotate{    return [self.topViewController shouldAutorotate];}我嘗試了這些東西的許多不同組合,以了解是否有用。如果vc2是橫向的,我主要是在強(qiáng)迫vc3以縱向顯示。任何幫助,將不勝感激。
查看完整描述

3 回答

?
隔江千里

TA貢獻(xiàn)1906條經(jīng)驗(yàn) 獲得超10個(gè)贊

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window

{

if ([self.window.rootViewController.presentedViewController isKindOfClass: [SecondViewController class]])

{

    SecondViewController *secondController = (SecondViewController *) self.window.rootViewController.presentedViewController;


    if (secondController.isPresented)

        return UIInterfaceOrientationMaskAll;

    else return UIInterfaceOrientationMaskPortrait;

}

else return UIInterfaceOrientationMaskPortrait;

}

對(duì)于斯威夫特


func application(application: UIApplication, supportedInterfaceOrientationsForWindow window: UIWindow) -> Int {


    if self.window?.rootViewController?.presentedViewController? is SecondViewController {


        let secondController = self.window!.rootViewController.presentedViewController as SecondViewController


        if secondController.isPresented {

            return Int(UIInterfaceOrientationMask.All.toRaw());

        } else {

            return Int(UIInterfaceOrientationMask.Portrait.toRaw());

        }

    } else {

        return Int(UIInterfaceOrientationMask.Portrait.toRaw());

    }


}


查看完整回答
反對(duì) 回復(fù) 2019-11-20
  • 3 回答
  • 0 關(guān)注
  • 648 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)