如下图所示,我已经设置了表格的背景和其他样式。以红色突出显示的索引是透明的。我如何将其设置为与单元格的其余部分一样的白色?
最佳答案
its too much easy dude.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
for(UIView *view in [tableView subviews])
{
if([[[view class] description] isEqualToString:@"UITableViewIndex"])
{
[view performSelector:@selector(setIndexColor:) withObject:[UIColor whiteColor]];
//give color which you want
}
}
static NSString *MyIdentifier = @"MyIdentifier";
//go further with table cell design...
}
关于iphone - iOS UITableView索引是透明的,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/12849114/