【发布时间】:2012-12-08 18:06:13
【问题描述】:
我正在尝试更改 InAppSettingKit 视图控制器的背景颜色。
我已经尝试子类化和覆盖 cellForRowAtIndexPath:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [super tableView:tableView cellForRowAtIndexPath:indexPath];
cell.textLabel.backgroundColor = [UIColor redColor];
cell.detailTextLabel.backgroundColor = [UIColor redColor];
return cell;
}
我尝试为 UIColor 创建一个类别:
+ (UIColor *)groupTableViewBackgroundColor {
return [UIColor redColor];
}
无论我尝试什么,模拟器都会显示正确的(预期的)行为,但我的 iPhone 会显示默认的组表背景。
有什么想法可以解决这个问题吗?也许这就是我在我的应用委托中创建 InAppSettingsViewController 实例的方式...?
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
IASKAppSettingsViewController *iaskvc = [[IASKAppSettingsViewController alloc] init];
i = [UIImage imageNamed:@"20-gear-2.png"];
[[iaskvc tabBarItem] setImage:i];
[[iaskvc tabBarItem] setTitle:@"Settings"];
// Create the Toolbar
UITabBarController *tabBarController = [[UITabBarController alloc] init];
NSArray *viewControllers = [NSArray arrayWithObjects:iaskvc, nil];
[tabBarController setViewControllers:viewControllers];
[[self window] setRootViewController:tabBarController];
[self.window makeKeyAndVisible];
return YES;
}
XCode:版本 4.5.2 (4G2008a) iOS 部署目标:5.1 iPhone 上的 iOS:6.0.1 (10A523)
【问题讨论】:
-
您是否尝试过从 iPhone 中删除应用程序并重新部署?
-
是的,好几次!我添加了新功能(例如,编辑标题、更改图标)只是为了确保重新安装。
标签: ios inappsettingskit