我有兩個視圖控制器,其中控制器A
和B
。 A
控制器在屏幕上顯示一些信息。在A
屏幕的右上方我有一個UIButton
按鈕的點擊我要顯示一個幫助屏幕,這將有一些標籤&當我觸摸屏的幫助應該消失。如何在iOS中顯示一個視圖控制器作爲疊加?
我可以通過增加在所有視圖&隱藏的頂視圖做到這一點,顯示它。但我想知道如何在UIButton
的點擊第一視圖控制器上顯示HelpScreenViewController
作爲半透明視圖控制器。當我點擊HelpScreenViewController
時,它應該消失。
編輯: 我加入以下代碼,但事先不工作
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"TopOverVc"];
vc.view.backgroundColor = [UIColor clearColor];
self.modalPresentationStyle = UIModalPresentationCurrentContext;
[self presentViewController:vc animated:NO completion:nil];
感謝。
這是一個故事。你的問題是什麼?你有什麼代碼?正如在指南中所解釋的,[不要只複製整個程序](http://stackoverflow.com/help/how-to-ask)並創建一個[Minimal,Complete,and Verifiable example](http:/ /stackoverflow.com/help/mcve)。 – tmthydvnprt
檢查更新問題 –