gpt4 book ai didi

ios - 与模拟器相比,自定义 iOS InAppSettingsKit 在 iPhone 上给出不同的结果

转载 作者:行者123 更新时间:2023-11-29 11:05:33 24 4
gpt4 key购买 nike

我正在尝试更改 InAppSettingKit View Controller 的背景颜色。

我已经尝试子类化和覆盖 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 会显示默认的组表背景。

关于如何解决这个问题有什么想法吗?也许这就是我在我的应用程序委托(delegate)中创建 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.1iPhone 上的 iOS:6.0.1 (10A523)

Simulator -- expected iPhone -- customisation not working

最佳答案

好的,所以我在阅读了关于 SO 的其他内容后找到了答案,这让我想得更远一些。

初始化我的子类 IASKAppSettingsViewController:

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

并添加我自己的 xib 文件(我以前没有)允许我自定义我需要的一切,然后它在 iPhone 上运行良好。

关于ios - 与模拟器相比,自定义 iOS InAppSettingsKit 在 iPhone 上给出不同的结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13780276/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com