3

iOS 7 に対応させたい iOS アプリを作成しました。

私が直面している問題は、iOS 7 でアプリを実行すると、背景画像がUINavigationBar非表示にtitleviewなり、back button

スクリーンショットはこちら:

-(void)viewDidLoad
{
    [super viewDidLoad];

    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"top.png"] forBarMetrics:UIBarMetricsDefault];

    self.title=@"Artist";
    self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStylePlain target:nil action:nil];


}

また、背景画像UINavigationBarをnilに設定すると、表示されtitleviewますback button

iOS 7 より前のアプリを実行すると、正しく動作します。

助けてください。 前もって感謝します。

4

4 に答える 4

9

iOS 7.0で for bar の動作tintColorが変更されました。以下の画像を確認してください。

ここに画像の説明を入力

あなたはそれを見ることができます

tintColor: ボタンの画像やタイトルなど、ナビゲーション バー内のインタラクティブな要素の色です。

barTintColorの背景色ですUINavigationBar

あなたの問題について:以下を行うことができます:

navigationBar.tintColor = [UIColor whiteColor];
navigationBar.barTintColor = [UIColor colorWithRed:6.0/255.0 green:12.0/255.0 blue:19.0/255.0 alpha:1.0];
于 2013-09-16T07:26:30.397 に答える
2

デフォルトのフォントの色は黒なので、おそらく黒の背景に黒のフォントを描いているでしょう。次のことを試してください。

[[UINavigationBar appearance] setTitleTextAttributes:
                              [NSDictionary dictionaryWithObjectsAndKeys:
                              [UIColor whiteColor], NSForegroundColorAttributeName,nil]];
于 2013-09-25T11:55:56.083 に答える
1

ビューのプロパティ インスペクターでプロパティの拡張エッジを確認してください。これにより、ナビゲーション バーの下部から画面の上部までエッジが拡張され、背景画像が適切な場所に配置されます。

ここに画像の説明を入力

iOS 7 の新機能について詳しく知りたい場合は、iOS 7 の移行ガイドを確認して ください https://developer.apple.com/library/prerelease/ios/documentation/UserExperience/Conceptual/TransitionGuide/index.html

于 2013-09-16T06:35:43.187 に答える
0

次のコードは私のために働いた

ビューでDidLoad

    self.navigationController.navigationBar.tintColor=[UIColor whiteColor];
于 2013-10-03T13:42:28.430 に答える