簡體   English   中英

情節提要ViewController中的透明背景

[英]transparent background in storyboard viewcontroller

我正在登錄屏幕。 我有以下情節提要。 在此處輸入圖片說明

我在代碼中所做的是。 設備上是否存儲了用戶名和密碼。 比passViewController彈出。 彈出其他登錄viewcontroller。 這很好。

我的問題是LoginViewController和PassViewController應該具有透明背景。 我知道如何使用單個xib文件執行此操作,但我想在情節提要中執行此操作,以便可以使用從Login和Passviewcontroller到nextController的序列。 目前,我正在用代碼執行此操作。

   UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
        UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"LoginViewController"];
        vc.view.backgroundColor = [UIColor clearColor];
        self.modalPresentationStyle = UIModalPresentationCurrentContext;
        [self presentModalViewController:vc animated:YES];

誰能幫助我實現這一目標。

親切的問候。

如果我的理解是正確的,則只需單擊視圖控制器的視圖,例如LoginViewController的視圖。 那是控制器視圖層次結構中的第一個視圖。 然后,在屬性檢查器的屏幕右側,可以將視圖的背景色設置為“純色”。 那是您要找的東西嗎?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM