簡述
? ? ?在使用自定義present動(dòng)畫之后再present其它頁面焕妙,有可能造成dismiss之后app導(dǎo)航欄異常纬霞,如導(dǎo)航動(dòng)畫缺失冻辩,屏幕點(diǎn)擊無響應(yīng)越败,navigation表現(xiàn)異常等一些疑難雜癥的表現(xiàn)触幼。解決該問題主要有以下幾個(gè)排查思路:
檢查自定義動(dòng)畫是否正確調(diào)用聲明周期函數(shù)
檢查在自定義動(dòng)畫中是否正確調(diào)用
// 動(dòng)畫開始? ?
[fromViewController beginAppearanceTransition:NO animated:YES];? ?
[toViewController beginAppearanceTransition:YES animated:YES];
// 動(dòng)畫結(jié)束? ? ? ? ? ?
[fromViewController endAppearanceTransition];? ? ? ? ? ?
[toViewController endAppearanceTransition];? ? ? ? ? ?
[transitionContext completeTransition:!transitionContext.transitionWasCancelled];
? ? ?以上代碼必定成對(duì)出現(xiàn),即顯示是要有究飞,dismiss時(shí)也要有域蜗。
present的controller的modalPresentStyle,在fullscreen和overfullscreen之間選擇噪猾,則盡量使用fullscreen霉祸。
系統(tǒng)級(jí)問題,無法解決袱蜡,使用overfullscreen當(dāng)自定義動(dòng)畫在dismiss的animated為false的情況下丝蹭,由于沒有執(zhí)行disappear,會(huì)導(dǎo)致navigation的問題坪蚁。除非新的自定義動(dòng)畫執(zhí)行時(shí)不執(zhí)行動(dòng)畫生命周期(上述代碼)奔穿,但這樣往往帶來業(yè)務(wù)問題。使用fullscreen則不會(huì)存在該問題敏晤。