ナビゲーション バーとビューを分ける線の色を変更するにはどうすればよいですか? たとえば、flickr はグレーに変更しました ( http://www.geardiary.com/wp-content/uploads/2009/09/Screen-shot-2009-09-08-at-8.00.06-AM.png ) 。
デフォルトでは、私のものは常に黒です...
助けてくれてありがとう、ニコ
ナビゲーション バーとビューを分ける線の色を変更するにはどうすればよいですか? たとえば、flickr はグレーに変更しました ( http://www.geardiary.com/wp-content/uploads/2009/09/Screen-shot-2009-09-08-at-8.00.06-AM.png ) 。
デフォルトでは、私のものは常に黒です...
助けてくれてありがとう、ニコ
Apple が提供するものではなく、カスタムのボトムバーを使用しました。あなたの設定はわかりませんが、独自のカスタムビューを好きなように作成または描画でき(これを行うことができます)、それにボタンを貼り付けることができる場合(これも行うことができます)、ツールバーがあります
#define TOOLBAR_HEIGHT 44
CGRect frame = CGRectMake(self.view.bounds.size.height - TOOLBAR_HEIGHT, 0.0, self.view.bounds.size.width, TOOLBAR_HEIGHT);
UIView *customBottomBar = [[UIView alloc] initWithFrame:frame];
[customBottomBar setBackgroundColor: [UIColor grayColor]];
UIButton *button = [[UIButton alloc] initWithFrame:<frame goes here>]
... <button setup>
[customBottomBar addSubview:button];
[button release];
...<more buttons>
...<more buttons>
[self.view addSubview:customBottomBar];
[customBottomBar release];
そして、あなたの質問に答えるために、どのビューにも好きなものを追加することができるので、私が提案した方法が最もカスタマイズ可能ですが、適切な場所 (既存のツールバーの上) に高さ 1 ピクセルの色付きのバーを配置することもできます。 )これを行うことによって:
CGRect frame = CGRectMake(self.view.bounds.size.height - TOOLBAR_HEIGHT, 0.0, self.view.bounds.size.width, 1);
UIView *customLine = [[UIView alloc] initWithFrame:frame];
[customLine setBackgroundColor: [UIColor grayColor]];
[self.view addSubview:customLine];
[customLine release];