Ios 如何设置moreNavigationController表的选择颜色?

Ios 如何设置moreNavigationController表的选择颜色?,ios,ios6,uitabbarcontroller,Ios,Ios6,Uitabbarcontroller,如何设置iOS 6上“更多视图控制器”选项卡中列出的视图控制器的单元格选择颜色 默认颜色是蓝色,这在使用非默认颜色的应用程序中看起来很糟糕。如果可能的话,我想将其设置为自定义颜色,但将其设置为灰色即可 此问题特定于iOS 6,因为在iOS 7上使用了灰色选择颜色。我们可以通过为MoreNavigationController创建自定义数据源来更新“视图控制器的更多”选项卡中列出的视图控制器的单元格选择颜色 我创建了一个示例项目,可能有助于- 在自定义数据源对象中,我们可以重写cellForRo

如何设置iOS 6上“更多视图控制器”选项卡中列出的视图控制器的单元格选择颜色

默认颜色是蓝色,这在使用非默认颜色的应用程序中看起来很糟糕。如果可能的话,我想将其设置为自定义颜色,但将其设置为灰色即可


此问题特定于iOS 6,因为在iOS 7上使用了灰色选择颜色。

我们可以通过为MoreNavigationController创建自定义数据源来更新“视图控制器的更多”选项卡中列出的视图控制器的单元格选择颜色

我创建了一个示例项目,可能有助于-

在自定义数据源对象中,我们可以重写cellForRowAtIndexPath方法来设置单元格的selectedbackgroundView

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
  UITableViewCell *cell = [originalDataSource tableView:tableView cellForRowAtIndexPath:indexPath];

  // Set background color
  UIView *background = [[UIView alloc] initWithFrame:cell.frame];
  background.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
  background.backgroundColor  = [UIColor whiteColor];
  cell.backgroundView = background;

  // Set selected background color
  UIView *selectionColor = [[UIView alloc] initWithFrame:cell.frame];
  selectionColor.backgroundColor = [UIColor greenColor];
  selectionColor.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
  cell.selectedBackgroundView = selectionColor;

  return cell;
}

哇!非常彻底。谢谢。:)