【修改tableview的导航颜色和背景】

   

 for (UIView *subview in [mainTableView subviews])

    {

        if ([subview isKindOfClass:NSClassFromString(@"UITableViewIndex")])

        {

            [subview performSelector:@selector(setBackgroundColor:) withObject:[UIColor clearColor]];

            // [subview setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"indexbg.png"]]];

        }

        if([subview respondsToSelector:@selector(setIndexColor:)])

        {

            [subview performSelector:@selector(setIndexColor:) withObject:[UIColor redColor]];

        }

        

        if([subview respondsToSelector:@selector(setIndexBackgroundColor:)])

        {

//            [subview performSelector:@selector(setIndexBackgroundColor:) withObject:[UIColor greenColor]];

        }

    }

  

posted @ 2013-04-11 17:44  码匠阿杰  阅读(242)  评论(0编辑  收藏  举报