Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible to set padding and width to AlertViewController with a custom view #8

Open
fhucho opened this issue May 14, 2021 · 7 comments

Comments

@fhucho
Copy link

fhucho commented May 14, 2021

No description provided.

@devpolant
Copy link
Owner

Hello @fhucho ! Can you please describe issue in more detail?

@fhucho
Copy link
Author

fhucho commented May 14, 2021

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.

@devpolant
Copy link
Owner

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
Copy link
Author

fhucho commented 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
Copy link
Author

fhucho commented May 19, 2021

So... what do you think? :)

@devpolant
Copy link
Owner

@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.

@fhucho
Copy link
Author

fhucho commented 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants