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

[Feature] How to modify UI based on CardComponent? #766

Closed
yujingning opened this issue Jan 19, 2022 · 6 comments
Closed

[Feature] How to modify UI based on CardComponent? #766

yujingning opened this issue Jan 19, 2022 · 6 comments

Comments

@yujingning
Copy link

yujingning commented Jan 19, 2022

Describe the challenge
Hi~
I'm using CardComponent, but our design is different from the current UI provided by CardComponent. Is there a way to make some modifications based on CardComponent? Such as add a UILabel above the confirm button.

image

SDK Version: 4.4.0

@yujingning
Copy link
Author

yujingning commented Jan 19, 2022

Find the corresponding stackview through the view hierarchy, and then insert a customview into the stackView.

   guard let componentViewController = cardComponent?.viewController as? SecuredViewController,
              let rootViewController = componentViewController.children.first as? FormViewController,
              let scrollView = rootViewController.view.subviews.first as? UIScrollView,
              let stackView = scrollView.subviews.first as? UIStackView else {
            return
        }
  guard stackView.subviews.count > 4 else { return }
  stackView.insertArrangedSubview(tipStackView, at: 3)

@descorp
Copy link
Contributor

descorp commented Jan 19, 2022

Hey @yujingning

There is no easy way to do it, but we are planing to decouple form and "Submit" button in v5.

@descorp descorp reopened this Jan 19, 2022
@descorp descorp changed the title [NEED ASSIST] How to modify UI based on CardComponent? [Feature] How to modify UI based on CardComponent? Jan 19, 2022
@yujingning
Copy link
Author

Hey @yujingning

There is no easy way to do it, but we are planing to decouple form and "Submit" button in v5.

Okay~Thanks for your quick reply. If we can control the Views on CardComponent, it will be very convenient for us to make some modifications
Now I find the corresponding StackView in CardComponent through the view hierarchy, and then I can insert a custom View.

@lpuentes19
Copy link

lpuentes19 commented Nov 11, 2022

I'm currently using the 5.0.0 Adyen SDK and have this exact same question. We tried following @yujingning steps in casting our way to the stackView, but it looks like SecuredViewController and FormViewController are both internal and not accessible in the code and therefore throws an error. Is there a way to add in a custom view to the Card Component form?

Also, is it possible to add a border for the textField's and not have it be just a line below the text? @descorp @mohammedDehairy

@neelSharma12
Copy link
Contributor

neelSharma12 commented Nov 14, 2022

@yujingning We cannot do any modifications on CardComponent for adding custom views at the moment. @lpuentes19 Thank you for sharing your feedback. I will share this with concerned team but for now could you please create a separate ticket for adding the border to the textFields?

@goergisn
Copy link
Contributor

goergisn commented Dec 3, 2024

We just shipped 5.14.0 which allows you to use a custom pay button and thus add content below the form.

I'm closing the issue but feel free to re-open if there are any additional questions. :)

@goergisn goergisn closed this as completed Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants