如何修改UITableView右边的带有索引的视图的背景色
1个回答
推荐于2016-02-15 · 知道合伙人数码行家
huanglenzhi
知道合伙人数码行家
向TA提问 私信TA
知道合伙人数码行家
采纳数:117538
获赞数:517184
长期从事计算机组装,维护,网络组建及管理。对计算机硬件、操作系统安装、典型网络设备具有详细认知。
向TA提问 私信TA
关注
展开全部
修改该uitableview的索引的背景
1
for (UIView *subview in [tableView
subviews])
2
{
3
if ([subview
isKindOfClass:NSClassFromString(@"UITableViewIndex")])
4
{
5
[subview
performSelector:@selector(setBackgroundColor:) withObject:[UIColor
colorWithHue:0.0f saturation:0.0f brightness:0.0f
alpha:0.30f]];
6
// [subview setBackgroundColor:[UIColor
colorWithPatternImage:[UIImage
imageNamed:@"indexbg.png"]]];
7
}
8
if([subview
respondsToSelector:@selector(setIndexColor:)])
9
{
10
[subview
performSelector:@selector(setIndexColor:) withObject:[UIColor
redColor]];
11
}
12
if([subview
respondsToSelector:@selector(setIndexBackgroundColor:)])
13
{
14
[subview
performSelector:@selector(setIndexBackgroundColor:) withObject:[UIColor
colorWithPatternImage:[UIImage
imageNamed:@"indexbg_highlighted.png"]]];
15
// [subview
performSelector:@selector(setIndexBackgroundColor:) withObject:[UIColor
colorWithHue:0.0f saturation:0.0f brightness:0.0f
alpha:0.16f]];
16
}
17
}
缘博客版权所有,转载请注明来自缘的博客。
1
for (UIView *subview in [tableView
subviews])
2
{
3
if ([subview
isKindOfClass:NSClassFromString(@"UITableViewIndex")])
4
{
5
[subview
performSelector:@selector(setBackgroundColor:) withObject:[UIColor
colorWithHue:0.0f saturation:0.0f brightness:0.0f
alpha:0.30f]];
6
// [subview setBackgroundColor:[UIColor
colorWithPatternImage:[UIImage
imageNamed:@"indexbg.png"]]];
7
}
8
if([subview
respondsToSelector:@selector(setIndexColor:)])
9
{
10
[subview
performSelector:@selector(setIndexColor:) withObject:[UIColor
redColor]];
11
}
12
if([subview
respondsToSelector:@selector(setIndexBackgroundColor:)])
13
{
14
[subview
performSelector:@selector(setIndexBackgroundColor:) withObject:[UIColor
colorWithPatternImage:[UIImage
imageNamed:@"indexbg_highlighted.png"]]];
15
// [subview
performSelector:@selector(setIndexBackgroundColor:) withObject:[UIColor
colorWithHue:0.0f saturation:0.0f brightness:0.0f
alpha:0.16f]];
16
}
17
}
缘博客版权所有,转载请注明来自缘的博客。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询