You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make it possible to set padding and width to AlertViewController with a custom view #8
Hi @devpolant, I'm trying to to create a native-looking dialog with these requirements:
The dialog should be fully covered with a custom view. This is not possible right now, because there's a padding between the dialog and the custom view inside it.
Also, I may need to make it slightly wider than the default width, but this is not necessary.
This was designed for Android so it doesn't have to look exactly like this. The shadow, background, corner radius and fonts should be adjusted to look native on iOS.
@fhucho It doesn't look as native alert. The main purpose of this pod is to provide customisable but native appearance at first.
Native alert doesn't have such UI elements like in your design:
title as image
close button in top right corner
action buttons
I think it's possible to make the following updates:
For your case it is better not just to remove padding for contentView, but to swap the whole AlertView with custom view in AlertController. Because native actions at the bottom won't look as in your design.
As a solution we can try to pass UIView object into some convenience initializer instead of AlertViewModel -> you will be responsible for the whole interaction with such custom view.
True, it doesn't look native. What I'm trying to do is to make it look more native by adjusting the animation, shadow, background color and corner radius. This design doesn't have any action buttons, it just contains a header and a scollable list of items.
Also, depends on how you define native, it could be argued that any customization outside of what's possible natively is not native.
Regarding the suggested solution - would my custom view have to include a native-looking background and shadow?
Activity
devpolant commentedon May 14, 2021
Hello @fhucho ! Can you please describe issue in more detail?
fhucho commentedon May 14, 2021
Hi @devpolant, I'm trying to to create a native-looking dialog with these requirements:
devpolant commentedon May 15, 2021
ok, got your idea. Do you have UI design for it? Maybe you can attach screenshot of the required alert if it is possible.
fhucho commentedon May 17, 2021
Yeah, sure, it should look similar to this:
This was designed for Android so it doesn't have to look exactly like this. The shadow, background, corner radius and fonts should be adjusted to look native on iOS.
fhucho commentedon May 19, 2021
So... what do you think? :)
devpolant commentedon May 25, 2021
@fhucho It doesn't look as native alert. The main purpose of this pod is to provide customisable but native appearance at first.
Native alert doesn't have such UI elements like in your design:
I think it's possible to make the following updates:
contentView, but to swap the wholeAlertViewwith custom view inAlertController. Because native actions at the bottom won't look as in your design.As a solution we can try to pass
UIViewobject into some convenience initializer instead ofAlertViewModel-> you will be responsible for the whole interaction with such custom view.fhucho commentedon May 27, 2021
True, it doesn't look native. What I'm trying to do is to make it look more native by adjusting the animation, shadow, background color and corner radius. This design doesn't have any action buttons, it just contains a header and a scollable list of items.
Also, depends on how you define native, it could be argued that any customization outside of what's possible natively is not native.
Regarding the suggested solution - would my custom view have to include a native-looking background and shadow?