Domanda

Come posso cambiare il colore della linea che separa la barra di navigazione e la vista? Ad esempio, Flickr l'ha cambiato in grigio ( http://www.geardiary.com/wp-content/uploads/2009/09/Screen-shot-2009-09-08-at-8.00.06-AM.png )

Di default il mio è sempre nero ...

Grazie in anticipo per il tuo aiuto, nico

È stato utile?

Soluzione

Hanno usato una barra in basso personalizzata e non quelle fornite da Apple. Non conosco la tua configurazione, ma se puoi creare o disegnare la tua vista personalizzata come preferisci (puoi farlo) e incollare i pulsanti su di essa (puoi farlo anche tu), allora hai una barra degli strumenti

#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];

E per rispondere alla tua domanda, puoi aggiungere quello che vuoi a qualsiasi vista, quindi mentre il modo in cui ti suggerisco è il più personalizzabile, potresti semplicemente voler posizionare una barra colorata alta 1pixel nel punto giusto (in cima a la barra degli strumenti esistente):

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];
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top