1

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

Steaphann
  • 2,797
  • 6
  • 50
  • 109
  • 1
    Dont make your _tableView alpha set to .5, Instead first add a UIView with alpha 0.5 to your parent tableview and then add your another table to parent tableView. Hope it helps you.. – P.J Jan 31 '13 at 09:46

3 Answers3

4

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..

P.J
  • 6,547
  • 9
  • 44
  • 74
4

try this...

yourView.backgroundColor = [UIColor blackColor];
yourView.alpha = 0.40;
Rahul Gupta
  • 808
  • 11
  • 15
0

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.

Bharat Gulati
  • 796
  • 6
  • 12