UINavigationBar下部セパレーターの線の色
-
07-07-2019 - |
質問
ナビゲーションバーとビューを分ける線の色を変更するにはどうすればよいですか? たとえば、flickrはグレーに変更しました( http://www.geardiary.com/wp-content/uploads/2009/09/Screen-shot-2009-09-08-at-8.00.06-AM.png )
デフォルトでは、鉱山は常に黒です...
ご協力ありがとうございます。 nico
解決
彼らは、アップルが提供したものではなく、カスタムのボトムバーを使用しました。私はあなたの設定を知りませんが、あなたが望むようにあなたがあなた自身のカスタムビューを作成または描画し(あなたがこれを行うことができます)、そしてそれにボタンを付ける(あなたもこれを行うことができます)なら、あなたはツールバーを持っています
#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];
所属していません StackOverflow