Question

I have a tableview that shows up when I push a button. This tableview is added on top of my other UITableview. What I want to do now is when the tableview shows up. My background view is dimmed like when an alertview pops up. You can see an example over here.

I've tried this in code but it doesn't work.

_tableView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];

enter image description here

Was it helpful?

Solution

Just adding answer with more description that my comment.

Say your Background tableView is _tableView and your pop up small tableView is _tableViewSmall

  1. Create a UIView having same height and width as of _tableView. Do addSubView on your _tableView. yourView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];

  2. Now add your _tableViewSmall doing addSubView on _tableView.

Hope this steps helps you to make it..

OTHER TIPS

try this...

yourView.backgroundColor = [UIColor blackColor];
yourView.alpha = 0.40;

Make a blank black uiview on top of your table view and set its alpha as needed in the storyboard.KEEP IT HIDDEN. When alertview pops up show the view.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top