我不知道如何處理動畫,我希望在半透明視圖中淡入淡出,並在Tumblr應用程序如何爲其撰寫屏幕輕觸背景時解除它。我如何淡入半透明的UIVIew中,並在bg被觸摸時解散?
這是我到目前爲止。它增加了半透明的觀點,但並沒有像Tumblr那樣褪色。
UIView *modalView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[modalView setOpaque: NO];
[modalView setBackgroundColor: [UIColor colorWithAlphaComponent: 0.9];
[[self view] addSubview: modalView];
你想顯示的模型圖?你是否使用多個視圖控制器來完成這項工作? –
@RandyMarsh是的,即時通訊嘗試顯示模式視圖,但與透明度,所以我仍然可以看到視圖控制器類似於tumblr應用程序 – James2303
爲什麼你添加'modalView'到視圖控制器的視圖?如果'modalView'是你的模態視圖,則使用一個視圖控制器來管理'modalView'並使用'presentViewController:animated:completion:'。在模態視圖控制器上,預先使用'-setTransitionStyle:'將過渡樣式設置爲'UIModalTransitionStyleCrossDissolve'。 –