4
QLPreviewController * preview = [[QLPreviewController alloc] init];
preview.dataSource = self;
preview.currentPreviewItemIndex = sender.tag;
preview.editing= YES; 
[self presentModalViewController:preview animated:YES];
[preview release];

これらの2行は私には機能しません。したがって、これらの行を書く前に注意してください。

[preview.tabBarController.tabBar setTintColor:[UIColor blackColor]];
[preview navigationController].navigationBar setTintColor: [UIColor blackColor]];

問題のスクリーンショットはこちら

4

4 に答える 4

2

navigationBar の tintColor を変更したい場合は、モーダルに提示する代わりに QLPreviewController をプッシュできます。

//i assume that you already have a navigationController
[[self navigationController] pushViewController:previewer animated:YES];
[self.navigationController.navigationBar setTintColor:[UIColor blackColor]];

一番下のバーについては、それは UITabBar ではなく UIToolbar だと思います。おそらく色を変更することはできませんが (わかりません) preview.tabBarController.tabBar、.

于 2012-11-21T12:16:30.760 に答える
2

この行で のスタイルを設定UINavigationControllerします..

self.navigationController.navigationBar.barStyle = UIBarStyleBlack;

TabBar の色を変更するにviewWillAppearは、クラスに以下のコードを追加するだけです

CGRect frame = CGRectMake(0.0, 0.0, self.view.bounds.size.width, 48);
UIView *v = [[UIView alloc] initWithFrame:frame];
[v setBackgroundColor:[UIColor colorWithRed:0.1 green:0.2 blue:0.6 alpha:0.8]];
[v setAlpha:0.5];
[[self.tabBarController tabBar] insertSubview:v atIndex:0];
[v release];
于 2012-11-21T12:02:07.557 に答える