NotificationBanner icon indicating copy to clipboard operation
NotificationBanner copied to clipboard

How to add buttons to the banner?

Open ins0u opened this issue 7 years ago • 6 comments

Hello,

I like your project, it is easy and fast to use ^^

I have a question: Is it possible to put buttons in the banner like this ?

banner

If it's possible, how ?

Thx for your help ^^

ins0u avatar Apr 19 '19 12:04 ins0u

Hi @ins0u! 😄 You will need to create a custom view with the buttons then when you initialize your banner, use the NotificationBanner(customView: yourCustomView) initializer.

Daltron avatar Apr 19 '19 13:04 Daltron

Yes that's what I understood by downloading the examples..

With NorthCarolinaBannerView, you create your custom view programmatically but how create view with storyboard/xib ? If you have a quick example, I can easily adapt it :D

Sorry for my question, I am a beginner with swift/xcode and thank you for your help :)

ins0u avatar Apr 19 '19 13:04 ins0u

Ok.. New Problem..

I create my customView with success.

This is my code :

bannerCustomView

To use it, this is my code :

let maCustomView = BannerEtesVousEnSecuriteView()
let banner = NotificationBanner(customView: maCustomView)
banner.autoDismiss = false
banner.show()

But I have a little problem with the result :

screenBannerBug

Why my customView does not come down below the buttons like in my xib ? :/ Have you an idea ? :)

ins0u avatar Apr 30 '19 13:04 ins0u

Hey @ins0u, easy way change banner.bannerHeight = 100. Best way set constraint and calculate height like GrowingBannerView

Vitalik13 avatar May 04 '19 13:05 Vitalik13

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 03 '19 14:07 stale[bot]

This issue has been automatically closed due to inactivity.

stale[bot] avatar Jul 10 '19 15:07 stale[bot]