tags:

views:

186

answers:

1

I feel this should be a simple property, but for the life of me I've searched and cannot find the answer.

I have a tableview index to the right of my table. When selected, it grays out everything. I'd like to mimic the iPod app, whereby when the index itself is selected, it is semi-transparent (alpha of maybe .4f).

Any ideas?

A: 

From what I found this might be able to do it (but might get your app rejected):

- (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath {    

  for(UIView *view in [tv subviews])
{
    if([[[view class] description] isEqualToString:@"UITableViewIndex"])
 {

  [view setAlpha:0.4];

 }
}

 //rest of cellForRow handling...

}
Matt S.
Including the name of a private class is probably a good way to get rejected. If you wanted to be a little more sneaky about it, try identifying the view by the tall, skinny aspect ratio of its frame.
Colin Barrett
oh yea, forgot to mention that
Matt S.
Thanks. With the new rejection methodology Apple is using now, I'm leery of stepping outside the rules. I'm just surprised this isn't a simple property. Oh well.
jj
I would chance it. The worst that can happen is apple rejects the application
Matt S.
Unfortunately the alpha setting only changes the UITableviewIndex's alpha. I can't seem to set the highlighting color (gray) to an alpha setting to fix this problem. btw: This is all caused because I'm using a black background, and therefore the text is light gray. Can't find a way to change the font color either. Oh well...
jj
btw: An enhancement request has been submitted to Apple on this bug. Apple TS confirmed.
jj
awesome! I really hope apple adds that.
Matt S.