Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcode 7 swift how to make container view transparent

I have 5 tabs in my application. I need to add a floating button for quick action on all my tabs.

I've managed to add the floating button at the bottom, just above the tab bar using a container view. So the container is positioned at bottom right and has a view controller which holds the button.

The problem is, if I add table views to my pages, since the container view is in front, a part of table views gets hidden. How do I make the container view transparent, so the user can see and scroll properly the table view..

like image 962
Stacy J Avatar asked Sep 25 '16 19:09

Stacy J


2 Answers

Try to use yourContainerView.backgroundColor = UIColor.clearColor()

Swift 3: yourContainerView.backgroundColor = UIColor.clear

like image 172
David Seek Avatar answered Oct 22 '22 12:10

David Seek


You just need to decrease the value of alpha from the attribute inspector . 1 signifies max value (default value too) and 0 means complete transparent.

like image 36
Yashwin Munsadwala Avatar answered Oct 22 '22 11:10

Yashwin Munsadwala