podkovyrin / DWAlertController

UIAlertController re-implementation with controller containment support
MIT License
306 stars 27 forks source link

the background view is turn to white #3

Closed kaioser closed 4 years ago

kaioser commented 4 years ago

when i present a alert, the background is white , and i did not set the controller's backgrund color

liek this :

test

podkovyrin commented 4 years ago

It looks like modalPresentationStyle of the alert controller was set to incorrect value (it should be UIModalPresentationCustom). Also, notice that the background color of the content controller should be explicitly set to UIColor.clear.

kaioser commented 4 years ago

It looks like modalPresentationStyle of the alert controller was set to incorrect value (it should be UIModalPresentationCustom). Also, notice that the background color of the content controller should be explicitly set to UIColor.clear.

here is my code:

test2 test3

Strangely enough, when I was debugging this APP with the cable, it works fine.

but when i did not use the cable, and run this app, the background view is turn to white.

podkovyrin commented 4 years ago

The usage of DWAlertController looks good. Btw, you don't need to set modalPresentationStyle at all neither on your content controller (vc) nor alert itself. All appearance and transitions are managed by DWAlertController class. Please check the Example app if you have issues on your device with any of the custom alerts there. I would suggest adding your CMDataSetAlertController to the Example app and check if you still have those background color issues.

kaioser commented 4 years ago

The usage of DWAlertController looks good. Btw, you don't need to set modalPresentationStyle at all neither on your content controller (vc) nor alert itself. All appearance and transitions are managed by DWAlertController class. Please check the Example app if you have issues on your device with any of the custom alerts there. I would suggest adding your CMDataSetAlertController to the Example app and check if you still have those background color issues.

thanks man,I thought again,and i I found there a category in my project, like this:

test4

this categoty reload the UIModalPresentationStyle, that's the problem!

Anyway, thanks man!