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

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

iOS:具有透明背景的Modal ViewController

iOS:具有透明背景的Modal ViewController

我正在嘗試以透明背景模態(tài)呈現(xiàn)視圖控制器。我的目標(biāo)是讓呈現(xiàn)和呈現(xiàn)的視圖控制器的視圖同時(shí)顯示。問(wèn)題是,當(dāng)演示動(dòng)畫(huà)結(jié)束時(shí),演示視圖控制器的視圖消失。- (IBAction)pushModalViewControllerButtonPressed:(id)sender{    ModalViewController *modalVC = [[ModalViewController alloc] init];    [self presentViewController:modalVC animated:YES completion:nil];}我知道我可以將視圖添加為子視圖,但是出于某種原因,我想避免這種解決方案。我該如何解決?
查看完整描述

3 回答

?
www說(shuō)

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

以下代碼僅適用于iPad。


self.view.backgroundColor = [UIColor clearColor];

self.modalPresentationStyle = UIModalPresentationCurrentContext;

[self presentModalViewController:modalVC animated:YES];

我會(huì)添加一個(gè)子視圖。


這是一個(gè)很好的討論。具體看一下評(píng)論。不只是答案。


模態(tài)視圖


如果我是你,我不會(huì)做。我將添加一個(gè)子視圖并執(zhí)行此操作。看來(lái)我可以更好地控制事物。


編輯:


正如Paul Linsay所提到的,自iOS 8起,所需要的只是UIModalPresentationOverFullScreen用于呈現(xiàn)ViewController的modalPresentationStyle。這也將覆蓋navigationBar和tabBar按鈕。


查看完整回答
反對(duì) 回復(fù) 2019-12-09
?
不負(fù)相思意

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

在iOS 8.0及更高版本中,可以通過(guò)將modalPresentationStyle屬性設(shè)置為UIModalPresentationOverCurrentContext來(lái)完成


//Set property **definesPresentationContext** YES to avoid presenting over presenting-viewController's navigation bar


self.definesPresentationContext = YES; //self is presenting view controller

presentedController.view.backgroundColor = [YOUR_COLOR with alpha OR clearColor]

presentedController.modalPresentationStyle = UIModalPresentationOverCurrentContext;


[self presentViewController:presentedController animated:YES completion:nil];


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

添加回答

舉報(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)