Present 一個 透明背景的UIViewController
Aug 29, 2021
這是一個滿常用在客製化Alert的首要步驟,但有個小地方需要注意,如果只把present 的UIViewcontroller背景設為透明是不夠的,會變成像這樣

設為透明後,結果變成全黑的背景
這時候只要記得設定modalPresentationStyle就可以了!
overFullScreen或overCurrentContext都可以

效果

這是一個滿常用在客製化Alert的首要步驟,但有個小地方需要注意,如果只把present 的UIViewcontroller背景設為透明是不夠的,會變成像這樣
設為透明後,結果變成全黑的背景
這時候只要記得設定modalPresentationStyle就可以了!
overFullScreen或overCurrentContext都可以
效果
Distraction-free reading. No ads.
Organize your knowledge with lists and highlights.
Tell your story. Find your audience.
Read member-only stories
Support writers you read most
Earn money for your writing
Listen to audio narrations
Read offline with the Medium app
大學讀企管/退伍後在業務圈打滾6年後突然有一天決定投入完全沒接觸過的程式設計/目前為一位iOS Developer/熱愛NBA/dafu1231@gmail.com