jim
jim

Reputation: 69

How to make a view become transparent to uncover background content?

I have set an image in background using this code:

 self.tableView.backgroundColor = UIColor(patternImage: UIImage(named: "image1")!)

However, I have some contentView on top, and I am trying to have those transparent to unveil the background.

How can this be done ? Thanks

Upvotes: 0

Views: 722

Answers (2)

AAA
AAA

Reputation: 1977

Use alpha

self.contentView.alpha = 0.1

If alpha = 1.0 then the view is opaque, you can also set it to 0.

Upvotes: 1

Glenn
Glenn

Reputation: 2806

for that view do the following :

thatView.backgroundColor = UIColor.clearColor()

Upvotes: 0

Related Questions