2012-12-08 98 views
1

我试图改变InAppSettingKit视图控制器的背景颜色。定制的iOS InAppSettingsKit给出了iPhone不同的结果相比,模拟器

我试过子类和重写的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 iOS版的iPhone:6.0.1(10A523)

Simulator -- expected iPhone -- customisation not working

+0

你试过从你的iPhone,并重新部署删除应用程序? –

+0

是的,好几次!我添加了新功能(例如编辑标题,更改图标),以确保我重新安装。 –

回答

2

好了,我找到了在阅读了关于SO的其他内容之后回答,这让我想得更远一点。

正开始我的子类IASKAppSettingsViewController有:

MyAppSettingsViewController *iaskvc = [[MyAppSettingsViewController alloc] initWithNibName:@"MyAppSettingsViewController" bundle:nil]; 

,并加入我自己的厦门国际银行文件(这之前我没有),让我定制我需要的一切,然后在iPhone上运行良好。

相关问题