Reputation:
I have a Navigation Bar, a Search Bar, and below, a Collection View.
My first question : I'd like to have a custom notification bar (alert message ?) that would appear right below my Search Bar, over my Collection View, only the first time I launch my app, with the possibility for the user to close it, like so :
I tried to use UIAlertControllers but obviously it's not gonna make it.
My second question :
Also, how could I manage to get the same Notification Bar/Message, but, this time, instead of placing it over my Collection View, I am trying to find a way to push down my Collection View Cells as my Notification Bar appears (animation?) to create an effect like that :
Thank you very much for your help !
Have a nice day,
J.
Upvotes: 1
Views: 289
Reputation: 3358
You can achieve this by using UICollectionReusableView. You just need to change the height of the header according to your requirement.
here is a sample project i have made for your reference. you can run it and try.
https://[email protected]/mahesh-agrawal/collection-popup-test.git
dropbox link - https://www.dropbox.com/s/j247mfshzld2tuj/collection-popup-test.zip?dl=0
check it.
Upvotes: 0
Reputation: 1693
The first question:
You can add a custom view(your custom notification bar) on top Window .
The second question:
You add custom view above your collectionview, and create outlet for height constraint of this customview.
If have notification, you set heightconstraint # 0 and set = 0 when not (with animation)
Upvotes: 0