Skip to content

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

Open

Description

@fhucho
No description provided.

Activity

  1. devpolant commented on May 14, 2021

    @devpolant
    Owner

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

  2. fhucho commented on May 14, 2021

    @fhucho
    Author

    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.
  3. devpolant commented on May 15, 2021

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

  4. fhucho commented on May 17, 2021

    @fhucho
    Author

    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.

  5. fhucho commented on May 19, 2021

    @fhucho
    Author

    So... what do you think? :)

  6. devpolant commented on May 25, 2021

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

  7. fhucho commented on May 27, 2021

    @fhucho
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions